• I’m using an event plugin and need to be able to add the organizer in the the shortcode.

    To list event organizer name on the page I use:
    <?php printf(get_organizer_name());?>

    How can I include this in the following shortcode:

    [event_description assigned_organizer=””]

    I NEED SOMETHING LIKE:

    [event_description assigned_organizer=”<?php printf(get_organizer_name());?>”]

    Any help will be massively appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • what does:

    $organizer = get_organizer_name();
    echo do_shortcode('[event_description assigned_organizer='.$organizer.']');

    do?

    Thread Starter ceedoo

    (@ceedoo)

    Thanks @tugbucket
    Much appreciated.

    Am I suppose to put:

    <?php

    ?>

    before an after?

    • This reply was modified 4 years, 6 months ago by ceedoo.
    Moderator bcworkz

    (@bcworkz)

    If you are inserting the code among existing HTML, then yes, you need the PHP tags. If you are inserting it among existing PHP code, then no, you don’t want to have nested PHP tags (like we do with HTML), that will cause a syntax error.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode with dynamic user content’ is closed to new replies.