I have a plugin that restricts contents for registered users only, on the other hand I have created a shortcode for showing a chat and I want to hide it using the restrictive shortcode;


But it doesnt work, what would be the best aproach?

The function to "Hide" restricted content uses;

function upme_private($atts, $content = null) {
        global $upme;
        return $upme->hidden_content($atts, $content);

and the shortcode that i created is

add_shortcode( 'barchat', 'barc_chat_script' );

Essentially what I want is to be able to hide the barchat shortcode from users by;


But I dont know how to modify the return of the upme_private function to include do_shortcode() since its already returning another function (hidden_content)

  • What doesn't work exactly? Post your code please.
    – s_ha_dum
    Jun 20, 2013 at 15:56

1 Answer 1


You're trying to create Nested Shortcodes so at the end of your handler which looks like function shortcode_handler($params, $content = null) do this :

 return do_shortcode($content);

instead of :

return $content;
  • Indeed it has something to do with nested shortcodes Jun 20, 2013 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.