Execute shortcode only in another shortcode

To use a different callback for the nested headings switch the shortcode handler in the pricing_box callback and restore the main handler before you return the string. add_shortcode( ‘pricing_box’, ‘shortcode_pricing_box’ ); add_shortcode( ‘heading’, ‘shortcode_heading_main’ ); function shortcode_pricing_box( $atts, $content=”” ) { // switch shortcode handlers add_shortcode( ‘heading’, ‘shortcode_heading_pricing_box’ ); $out=”<div class=”pricing-box”>” . do_shortcode( $content ) … Read more

stray elements

Remove the filter from the the_content and run it after the shortcode are processed. Try: remove_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘wpautop’ , 12); Usually shortcodes are processed after wpautop is applied to the content. See http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/shortcodes.php#L296

Why do_shortcode is not executing the shortcode in data-* html attributes?

do_shortcodes_in_html_tags() runs attributes through wp_kses_one_attr() which checks them against wp_kses_allowed_html( ‘post’ ) which by default only accepts standard non-data attributes, so you’d have to add your attribute: add_filter( ‘wp_kses_allowed_html’, function ( $allowedposttags, $context ) { if ( $context == ‘post’ ) { $allowedposttags[‘a’][‘data-abc’] = 1; } return $allowedposttags; }, 10, 2 );

How do I create shortcodes for my wordpress themes?

See the Shortcode API article on the Codex for a tutorial and my Shortcode Plugin for some examples. A very basic example for the functions.php: /** * Shortcode for bloginfo() * * Usage: [bloginfo key=”template_url”] * * @see http://codex.wordpress.org/Template_Tags/get_bloginfo * @source http://blue-anvil.com/archives/8-fun-useful-shortcode-functions-for-wordpress * @param array $atts * @return string */ function bloginfo_shortcode($atts) { extract( shortcode_atts( … Read more

How to pass multiple values in shortcode?

You can create your own shortcode which will hold all of that for you hardcoded: add_shortcode(“my_five_forms”,”my_five_forms_handler”); function my_five_forms_handler($atts,$content =null){ $con = “[frm-entry-delete-link id=9 page_id=25 field_key=hsn108] [frm-entry-delete-link id=12 page_id=25 field_key=cp7pi] [frm-entry-delete-link id=13 page_id=25 field_key=ksa9qv] [frm-entry-delete-link id=14 page_id=25 field_key=9zuf6o] [frm-entry-delete-link id=15 page_id=25 field_key=w8w7op]”; return do_shortcode($con); } // and use it like this: [my_five_forms] or create a shortcode … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)