[resolved] Shortcode conflicts with Jetpack (4 posts)

  1. cubecolour
    Posted 4 years ago #

    Slideshow doesn't work at all if Jetpack is installed with the Shortcode Embeds component active. Maybe more unique variable/shortcode names should be used?

    Fatal error: Cannot redeclare slideshow_shortcode() (previously declared in /home/sites/mysite/public_html/wp-content/plugins/jetpack/modules/shortcodes/slide.php:61) in /home/sites/mysite/public_html/wp-content/plugins/slideshow/slideshow.php on line 173


  2. Justin Tadlock
    WordPress God
    Plugin Author

    Posted 4 years ago #

    This is because the Jetpack plugin is not using a unique prefix for its function names.

    Please point the Jetpack plugin developer to this blog post, which explains how to properly prefix functions:

    The Jetpack plugin function slideshow_shortcode() should be renamed to jetpack_slideshow_shortcode().

  3. cubecolour
    Posted 4 years ago #

    Thanks Justin that's a good post by Andrew Nacin.

    As the slideshow plugin also has a generic sounding slideshow_shortcode() function, even though the prefix is the plugin name, is there not a case for that to be named with a more unique prefix as well?

  4. Justin Tadlock
    WordPress God
    Plugin Author

    Posted 4 years ago #

    I believe the slideshow_ prefix is perfectly used with the Slideshow plugin. It always makes sense to prefix function names with the name of the plugin itself. This makes it easy to avoid conflicts, assuming other plugin authors do the same.

    This is probably a case for a different function name but not a different prefix.

    Nevertheless, even with a change in function name, the function itself would be deprecated and still be lingering around for several more versions for backwards compatibility. Therefore, the fatal error would still occur.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Slideshow
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic