Ace Goulet

WordPress Shortcode-ception

How to enable a shortcode to render INSIDE another shortcode…shortcode-ception, if you will. Pretty simple, just wrap the $content part of your shortcode in the do_shortcode() function. Ex:

function caption_shortcode( $atts, $content = null ) {
     return '<span class="caption">' . do_shortcode($content) . '</span>';
}
Exit mobile version