Title: Shortcode with dynamic user content
Last modified: September 2, 2020

---

# Shortcode with dynamic user content

 *  [ceedoo](https://wordpress.org/support/users/ceedoo/)
 * (@ceedoo)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-with-dynamic-user-content/)
 * 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)

 *  [tugbucket](https://wordpress.org/support/users/tugbucket/)
 * (@tugbucket)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-with-dynamic-user-content/#post-13350088)
 * what does:
 *     ```
       $organizer = get_organizer_name();
       echo do_shortcode('[event_description assigned_organizer='.$organizer.']');
       ```
   
 * do?
 *  Thread Starter [ceedoo](https://wordpress.org/support/users/ceedoo/)
 * (@ceedoo)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-with-dynamic-user-content/#post-13350130)
 * Thanks [@tugbucket](https://wordpress.org/support/users/tugbucket/)
    Much appreciated.
 * Am I suppose to put:
 * <?php
 * ?>
 * before an after?
    -  This reply was modified 5 years, 9 months ago by [ceedoo](https://wordpress.org/support/users/ceedoo/).
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-with-dynamic-user-content/#post-13352540)
 * 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.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/shortcode-with-dynamic-user-content/#post-13352540)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
