wp_specialchars and wp_specialchars_decode in a shortcode plugin

The Codex description of these two functions: wp_specialchars: Converts a number of special characters into their HTML entities. Specifically deals with: &, <, >, “, and ‘. wp_specialchars_decode: Converts a number of HTML entities into their special characters. According to http://codex.wordpress.org/Function_Reference/wp_specialchars This function is deprecated as of WordPress 2.8.0. Please use esc_html instead. You don’t … Read more

how to show database content in wordpress post

For the sake of the example, I’ll assume you to have copied the relevant Table to the WordPress DB, to have named it wp_my_xtra_table and it to contain 3 columns (id,num_val,str_val). function wpse106832_shortcode_demo( $atts ) { global $wpdb; extract( shortcode_atts( array( ‘id’ => 1 ), $atts ) ); $table_row = $wpdb->get_row( ‘SELECT * ‘ . … Read more

How extend shortcode default values for a plugin?

You can hijack the shortcode and use your own additional logic. Sample code, not tested: add_action( ‘after_setup_theme’, function() { // Replace the plugin shortcode handler with your own. add_shortcode( ‘standout-css3-button’, function( $atts, $content = NULL ) { // Let the plugin make the button and store the result. $button = scss3button( $atts, $content ); // … Read more

How to link to a page that has a shortcode?

Transients are probably not the way to go here. From what I understand: You want to know if a post has a shortcode by doing some form of look up You want to be able to get a list of permalinks / posts that have this shortcode. Here’s what I suggest. /** * Checks for … Read more

Legacy Audio Shortcode

If your only issue is that the format is incorrect then switch it in the_content hook with the correct version. Non-local content: Place in a plugin or functions.php // hook earlier than 10 add_filter(‘the_content’, ‘wpse_20160110_the_content_fix_audio’, 0); function wpse_20160110_the_content_fix_audio($content){ return str_replace ( ‘[audio:’, ‘[audio src=”https://wordpress.stackexchange.com/questions/214052/, $content ); }