Problem: I am using a plugin that turns the wordpress gallery into a cool slide show.
How ever, every time I make a gallery – WordPress add this code to the post .
I need it to be this –
[wp-slideshow include=”334,332″]
Might be helpful:
I think this is the file controlling the output?
http://core.trac.wordpress.org/browser/tags/3.0.1/wp-includes/media.php#L745
remove_shortcode( 'gallery' );
add_shortcode( 'gallery', function( $atts ) {
$atts = shortcode_atts( array( 'ids' => '' ), $atts );
return do_shortcode( "[wp-slideshow include="$atts[ids]"]" );
} );
This may be better than replacing the gallery shortcode as if you decide to change plugin you will have the standard gallery shortcode which many plugins will work with directly.
@MagentaCuda’s solution is the simple solution and should function adequately. However, it does run the rather complicated shortcode regex twice, plus the additional processing of the
do_shortcode()
call. Both should be avoidable.You don’t name the plugin you are using and a search reveals many possibilities that I don’t have the time to dig through, so here is an out line and proof of concept code.
The idea is to avoid the second complex shortcode sequence by calling the plugin’s shortcode processing function directly.