How to parse nested shortcodes?

There’s a solution for that, actually. The shortcode you are using has the variable $content, whithout the filter do_shortcode, like this: do_shortcode($content) Open the file where there are the shortcodes and change $content for do_shortcode($content). It will work.

how do you get the author’s username?

In the Loop, it would be: $authorname = get_the_author_meta(‘user_nicename’); Or: $authorname = get_the_author_meta(‘displayname’); Or: $authorname = get_the_author_meta(‘nickname’); Or any field that get_the_author_meta() accepts. $authorname = get_the_author_meta(‘user_nicename’,123); If you just need to echo the name just use the_author_meta() instead: the_author_meta(‘user_nicename’,123);

How to add attribute to output with wp_video_shortcode add_filter

I get Undefined variable: for $video, $post_id and $library and the video’s in the page are blank. Replace: add_filter( ‘wp_video_shortcode’, ‘my_video_shortcode’, 10, 2 ); with: add_filter( ‘wp_video_shortcode’, ‘my_video_shortcode’, 10, 5 ); to access all five input arguments in your filter’s callback. ps: my_ is such a common prefix, that I would consider something more unique. … Read more

How can I just get content inside a shortcode or just outside

Depends on the shortcode. If you have access to the shortcode’s handler function, that function’s second argument is the content inside the shortcode: function wpse20136_shortcode( $atts, $content ){ // $content has the content inside xxx } register_shortcode( ‘xxx’, ‘wpse20136_shortcode’ ); For getting all content not in shortcodes, that’s easy. strip_shortcodes() does that: strip_shortcodes( get_the_content() ); … Read more

Run shortcode before filters

You can filter the array $no_texturize_shortcodes, which is a collection of shortcodes that are excluded from wptexturize. If you do this, everything within [codigo] shortcode tags will not be texturized: add_filter( ‘no_texturize_shortcodes’, ‘no_texturize_codigo_shortcode’ ); function no_texturize_codigo_shortcode( $excluded_shortcodes ) { $excluded_shortcodes[] = ‘codigo’; return $excluded_shortcodes; }

Using action hooks inside of a shortcode

Try this: function example_shortcode( $atts ) { $shortcode_output = “<p>Some shortcode content.</p>”; $shortcode_output .= “<p>More shortcode content.</p>”; ob_start(); do_action(‘below_shortcode’); $below_shortcode = ob_get_contents(); ob_end_clean(); $shortcode_output .= $below_shortcode return $shortcode_output; }

Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer

You can filter the HTML output for oEmbed with oembed_result. Now test the HTTP host of the URL for www.youtube.com and add the parameter. The oEmbed result is cached in a post meta field to avoid too many requests. To update old posts I have added an activation helper that clears those cached content for … Read more

Shortcode attribute value with dash (hyphen)

It’s safe, you won’t have any problem using it, the only caution about Hyphens and Shortcodes comes from the Codex. Take caution when using hyphens in the name of your shortcodes. In the following instance WordPress may see the second opening shortcode as equivalent to the first (basically WordPress sees the first part before the … Read more