Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is this the best way to enable nested shortcodes?:

add_filter( 'the_content', 'do_shortcode' );

I keep finding mixed results and want to be sure I won't break anything else!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes

Everything you need to know about nested shortcodes in WP

share|improve this answer
    
That mentions "provided their handler functions support it by recursively calling do_shortcode()" - So, doing it like above wouldn't be the way to go? –  hhins Nov 8 '11 at 16:31
    
Maybe a more appropriate question would be, would setting that above to the default priority (10) cause issues I'm unaware of? –  hhins Nov 8 '11 at 16:44
    
The line of code you have posted is useless. You are adding the do_shortcode function to the filter the_content. WordPress already does that automatically. Applying it again wont make things recursive. As the codex says: "provided their handler functions support it by recursively calling do_shortcode()" –  Brady Nov 8 '11 at 17:22
    
What shortcode are you nesting? –  Brady Nov 8 '11 at 17:24
    
It's just a handful of different column shortcodes, they don't rely on do_shortcode($content) in the shortcodes. It does work with the filter changed to priority 10 but I think I'll just rewrite them to use do_shortcode($content) as it states. I appreciate your quick replies. –  hhins Nov 8 '11 at 17:37
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.