Support » Plugin: User Shortcodes Plus » How to nest shortcodes ?

  • Resolved Phil



    I’m trying to add this shortcode for example [user_firstname] only for user logged in to avoid notice. So I use custome shortcode like :

    [member] … content … [user_firstname] …. content [/member] …

    but the shortcode [user_firstname] is not readed :-/

    works fine when I use others shortcodes but not these of your plugin 🙁
    Any help will be appreciate. TIA

    Note: I’ve tried to use this plugin Outerbridge Nested Shortcodes, without success

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kyle B. Johnson


    Hello, @magicfilou.

    The [member][/member] shortcode would need to call do_shortcode() on its contents for the nested shortcode to be processed.

    May I ask what plugin you are using that utilizes the [member] shortcode to restrict content? I would be happy to reach out to the developer to get this issue resolved.

    Thread Starter Phil


    Hi Kyle 🙂
    Sorry I just went to see your answer 🙂

    The member shortcode is generated by this functions :

    // add shortcode member

    add_shortcode( ‘member’, ‘member_check_shortcode’ );

    function member_check_shortcode( $atts, $content = null ) {
    if ( is_user_logged_in() && !is_null( $content ) && !is_feed() )
    return $content;
    return ”;

    Hope you can find a workflow 🙂

    Plugin Author Kyle B. Johnson


    It looks like the function member_check_shortcode() will need to be updated.

    If the enclosing shortcode is intended to permit other shortcodes in its output, the handler function can call do_shortcode() recursively:

    function my_shortcode( $atts, $content = null ) {
       return '<span>' . do_shortcode($content) . '</span>';


    Thread Starter Phil



    I went to test this very good plugin

    and works fine … I will drop my function 😉

    Thanks (y)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to nest shortcodes ?’ is closed to new replies.