From 9227be0c83b438e2a724d4a90b459803e64dac01 Mon Sep 17 00:00:00 2001 From: Andrea Baron Date: Thu, 23 Feb 2017 11:01:20 +0100 Subject: [PATCH] Interpret shortcodes within shortcode --- jg-force-full-width-shortcode.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jg-force-full-width-shortcode.php b/jg-force-full-width-shortcode.php index b70b387..6861417 100644 --- a/jg-force-full-width-shortcode.php +++ b/jg-force-full-width-shortcode.php @@ -9,7 +9,7 @@ * License: GPL2 */ -//register js script +//register js script function jg_ffw_script(){ wp_register_script( 'jg-force-full-width-shortcode-script', plugins_url( '/js/jg-force-full-width-shortcode.js', __FILE__ ) , array( 'jquery') ); } @@ -18,6 +18,8 @@ function jg_ffw_script(){ // adding shortcodes functions function jg_ffw_shortcode( $atts, $content = null ) { wp_enqueue_script( 'jg-force-full-width-shortcode-script' ); + // run shortcode parser recursively + $content = do_shortcode($content); return '
' . $content . '
'; } -add_shortcode( 'jg-ffw', 'jg_ffw_shortcode' ); \ No newline at end of file +add_shortcode( 'jg-ffw', 'jg_ffw_shortcode' );