Skip to content

Instantly share code, notes, and snippets.

@chriswagoner
Last active May 8, 2018 18:49
Show Gist options
  • Select an option

  • Save chriswagoner/63b840650feb53d17b185c633e0260b5 to your computer and use it in GitHub Desktop.

Select an option

Save chriswagoner/63b840650feb53d17b185c633e0260b5 to your computer and use it in GitHub Desktop.
Nested Shortcode via Filter
/**
* This will allow you to grab the output of an existing shortcode (you're probably already using)
* and execute the shortcodes you're using inside of it.
*/
function my_function_name ( $output, $tag ) {
if ( 'existing_shortcode_name' != $tag ) {
return $output;
}
$output = do_shortcode($output);
return $output;
}
add_filter('do_shortcode_tag', 'my_function_name', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment