WordPress.org

Ready to get started?Download WordPress

Forums

Gallery Slideshow
[resolved] Have any way to change "gallery" by "gss" automatically? (4 posts)

  1. BrunoSousa
    Member
    Posted 11 months ago #

    Hi. Thanks for this great plugin.

    My client doesn't have so much knowledge about editing shortcodes and html, so, I've hidden the "text" tab from him. I'd like to know if there is any way to change de word "gallery" in shortcode by "gss" automatically.

    Have any snippet to put in functions.php or something?

    I hope you can help me and already thank you in advance.

    Regards,

    Bruno Sousa.

    https://wordpress.org/plugins/gallery-slideshow/

  2. jethin
    Member
    Plugin Author

    Posted 11 months ago #

    Hi Bruno. No guarantees, but I believe adding this code to your theme's functions.php file should do the trick:

    remove_shortcode('gallery', 'gallery_shortcode');
    function gss_override_gallery($atts) {
    	$atts_string = '';
    	foreach($atts as $k => $v){
    		$atts_string .= ' ' . $k . '=' . $v;
    	}
    	$gallery_html = do_shortcode('[gss' . $atts_string . ']');
    	return $gallery_html;
    }
    add_shortcode('gallery', 'gss_override_gallery');
  3. jethin
    Member
    Plugin Author

    Posted 10 months ago #

    Marking this topic as resolved.

  4. BrunoSousa
    Member
    Posted 10 months ago #

    Worked perfectly!

    Thank you!

Reply

You must log in to post.

About this Plugin

About this Topic