do_shortcode within a shortcode

You can try this: add_shortcode( ‘content’,’content_callback’ ); function content_callback( $atts, $content = NULL ){ $atts = shortcode_atts(array( ‘pid’ => ”, ), $atts); if( ! is_int( 1 * $atts[‘pid’] ) ) return “<!– Shortcode Error: pid must be an integer –>”; if( absint( $atts[‘pid’] ) === get_the_ID() ) return “<!– Shortcode Error: pid can’t be the … Read more

Wrap php in shortcode

From Codex Shortcode Examples // In case there is opening and closing shortcode. echo do_shortcode(‘[iscorrect]’.$text_to_be_wrapped_in_shortcode.'[/iscorrect]’); Basically, you can’t use do_shortcode() two separate times for what is one shortcode consisting of a pair of tags. In your code you need to save your output to variables instead of using echo. Then at the end wrap it … Read more

Shortcode question…. javascript

WordPress offers a function called wp_localize_script. That function is your best friend for situations like yours. There are plenty of examples here. But I leave you with this good tutorial: http://pippinsplugins.com/use-wp_localize_script-it-is-awesome/