How to get rid of shortcodes in post content once and for all

Please backup your database before trying In your current theme, open the functions.php file and add the code below. In theshortcodeyouhate inform the shortcode you want to get rid of, note that even extended types works nicely! Once you added this code, hit F5 and you are done. add_action (‘init’,’remove_shortcode_from_db’); //you can choose any other … Read more

no content after shortcode

You forgot the closing </audio> tag at the end. function html5_audio($atts, $content = null) { extract(shortcode_atts(array( “src” => ”, “preload”=> ‘none’, “loop” => ” ), $atts)); return ‘<audio src=”‘.$src.'” preload=”‘.$preload.'” loop=”‘.$loop.'” /></audio>’; } add_shortcode(‘audio’, ‘html5_audio’);

add_shortcode() not working inside of function

Just use as per the following code sample in your plugin., function wp_shortcode( $atts ) { extract( shortcode_atts( array( ‘foo’ => ‘something’, ‘bar’ => ‘something else’, ), $atts ) ); //return “foo = {$foo}”; return your_function(); } add_shortcode( ‘your-shortcode’, ‘wp_shortcode’ ); I think this may help for you to get your needs.

How to split text text text into array

Firstly, you need to remove the paragraph tags that were added by the wp_autop filter. There’s another answer that covers this pretty well: Is there an uw-wp_autop function? I’m going to change the function a little for our purposes (based on the markup example you gave): function reverse_wpautop( $s ) { // Strip newlines $s … Read more

Adding option to Gallery shortcode

This code should work in your functions.php add_shortcode(‘gallery’, ‘custom_gallery_function’); function custom_gallery_function($atts) { $user = wp_get_current_user(); // if current user isn’t admin, add posts to be hidden to exclude if(!in_array(‘administrator’, $user->roles)) $atts[‘exclude’] = $atts[‘exclude’] . ‘,’ . $atts[‘hide’]; // call the wordpress shortcode function return gallery_shortcode($atts); }