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 ); }

How can I make a shortcode from this code?

It should be as simple as this: function item_count() { $dir=”/PATH TO DIRECTORY/”; $filecount = 0; $d = dir( $dir ); while ( $f = $d->read() ) { if ( ( $f!= “.” ) && ( $f!= “..” ) ) { if( ! is_dir( $f ) ) { $filecount++; } } } return ‘(‘ . … Read more

shortcodes between square and curly brackets

To WordPress, as it parses through the content, only the tags using square brackets will be treated as short codes. The curly bracket example given would not be parsed by the WordPress core. It is possible the tag would be parsed by a plugin or theme if they are looking for hooks in the content … Read more

Stop parsing shortcodes

The correct way is calling remove_filter with the same priority as the hook was added: remove_filter( ‘the_content’, ‘do_shortcode’, 11 ); Some plugins change this filter’s priority, so you could clear the global list of registered shortcodes temporary: add_filter( ‘the_content’, ‘toggle_shortcodes’, -1 ); add_filter( ‘the_content’, ‘toggle_shortcodes’, PHP_INT_MAX ); function toggle_shortcodes( $content ) { static $original_shortcodes = … Read more

sql query in shortcode not working

I have worked it out and here are the steps to what I did to get it working created a custom table in the wordpress database (called it wp-products) this table had the following fields: id, make, model, price Created a shortcode to retrieve the price. Shortcode looks like this [product_price id=2] where id=2 is … Read more