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

How can I fix those issues generated by the Themecheck plugin

Registering custom posts is a plugin territory. It means that you need to remove them from the theme’s functionality and register them via a plugin (usually recommended when installing the theme using TGM Plugin Activation or something else). Here are the recommendations of the Theme Review Team. Themes must not incorporate the following, Plugin-territory functionality. … Read more

Get post id shortcode

Place the below code to your themes functions.php or inside your plugin and the [return_post_id] shortcode will print the post ID. add_shortcode( ‘return_post_id’, ‘the_dramatist_return_post_id’ ); function the_dramatist_return_post_id() { return get_the_ID(); } Hope that helps.