Display shortcode in text field with wordpress settings api

Use a shortcode with parameters function oosdfw_title_display($atts) { $a = shortcode_atts( array( ‘before’ => ‘Sorry, ‘, ‘after’ => ‘ has sold out.’, ), $atts ); return $a[‘before’].get_the_title().$a[‘after’]; } add_shortcode( ‘oosd-title’, ‘oosdfw_title_display’ ); Put shortcode in text field and modify before and after parameters to suit your requirements. [oosd-title before=”Sorry ” after = ” has sold … Read more

SQL query to bulk change short code in all posts

As Birgire mentioned in the comments, you can hook into the gallery output rather than performing a search/replace on the database. From the WordPress Codex: Function Reference/shortcode atts gallery Provides the ability to filter the array returned from shortcode_atts(). You want something like this: add_filter( ‘shortcode_atts_gallery’, ‘gallery_shortcode_exclude_thumbnail’, 10, 3 ); function gallery_shortcode_exclude_thumbnail( $result, $defaults, $atts … Read more

PHP not outputting the onclick in anchor tag

I think WP is stripping the onclick out of the content. You shouldn’t really use inline onclick anyway. Give the link an ID and then add an on click in your JS. Something like this… jQuery(‘#myLink’).click(function() { … Your myFunction() code });

How to use strip_shortcodes() from a spawned process?

You can manually add shortcodes to the array of tags to be stripped in strip_shortcodes() via filter. If the global $shortcode_tags either doesn’t exist or doesn’t contain what it should when your process is running then you’ll need to use that filter to add them back in. $tags_to_remove = apply_filters( ‘strip_shortcodes_tagnames’, $tags_to_remove, $content );

Print shortcode according to site language

That’s probably basic PHP. As all that’s needed would be some kind of map/array and then switch use the id according to what get_locale() returns. <?php // Provide a map if locales and shortcode IDs. $custom_footer = [ ‘ar’ => ‘319’, ‘en_US’ => ‘3181’, // … and so on ]; // Get the current language. … Read more

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