Shortcode:
[permalink][title][/permalink]
Output:
<a href="foobar">[title]</a>
Wordpress shortcode API sais, it's correct:
http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes
Any Ideas?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityShortcode:
[permalink][title][/permalink]
Output:
<a href="foobar">[title]</a>
Wordpress shortcode API sais, it's correct:
http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes
Any Ideas?
From the page you linked:
The shortcode parser correctly deals with nested shortcode macros, provided their handler functions support it by recursively calling do_shortcode():
You need to recursively call do_shortcode()
on any shortcode handler that could contain nested shortcodes. So for example:
function wpse18659_permalink( $atts, $content ){
return '<a href="' . get_permalink() . '" title="Permalink to ' . get_the_title() . '" alt="">' . do_shortcode( $content ) . '</a>';
}
add_shortcode( 'permalink', 'wpse18659_permalink' );
That should handle nested shortcodes just fine.