WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] Shortcode Slideshow conflicts with Jetpack by WordPress.com plugin (18 posts)

  1. bestsaigon
    Member
    Posted 3 years ago #

    I found that Jetback is processing shortcode [slideshow] and generate a error in result webpage before NextGen can reach this shortcode. So, we alway receive a blank space!

    Because Jetpack is official support by WordPress so I modified NextGen :-P

    By change shortcode of NextGen, I can fix this error:

    Step 1: open file </wp-content/plugins/nextgen-gallery/lib/>shortcodes.php

    Step 2: change shortcode name [slideshow] to [ngslideshow]

    Line 29: add_shortcode( 'slideshow', array(&$this, 'show_slideshow' ) );
    => add_shortcode( 'ngslideshow', array(&$this, 'show_slideshow' ) );

    Line 100: if ( stristr( $content, '[slideshow' )) {
    => if ( stristr( $content, '[ngslideshow' )) {

    Line 101: $search = "@(?:<p>)*\s*\[slideshow\s*=\s*(\w+|^\+)(|,(\d+)|,)(|,(\d+))\]\s*(?:</p>)*@i";
    => $search = "@(?:<p>)*\s*\[ngslideshow\s*=\s*(\w+|^\+)(|,(\d+)|,)(|,(\d+))\]\s*(?:</p>)*@i";

    Line 108: $replace = "[slideshow id=\"{$match[1]}\" w=\"{$match[3]}\" h=\"{$match[5]}\"]";
    => $replace = "[ngslideshow id=\"{$match[1]}\" w=\"{$match[3]}\" h=\"{$match[5]}\"]";

    Step 3: in posts, change all shortcodes [slideshow id=x] to [ngslideshow id=x] and it will work like a charm!!!

    Sorry for my bad English.

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. Justin Tadlock
    Member
    Posted 3 years ago #

    Because Jetpack is official support by WordPress...

    I just wanted to point out that Jetpack is *not* officially supported by WordPress. It is a product made by the company Automattic.

  3. Doogman
    Member
    Posted 3 years ago #

    So, will there be a mod to NextGen soon? I LOVE NextGen Gallery and use it on a number of sites: http://www.coloradanmagazine.org for one!

  4. MiaV
    Member
    Posted 3 years ago #

    Sorry if this is a silly question - but is bestsaigon saying that if this plugin is activated, my NextGen galleries will go blank? Our site relies pretty heavy on NextGen, and as you can tell by my question, I am no expert.
    Thanks

  5. Alex Rabe
    Member
    Posted 3 years ago #

    it's up to automatic if they will write a compat patch, but don't expect this. So under the line you can't use it in combination with NGG

  6. Hoitl
    Member
    Posted 2 years ago #

    @bestsaigon

    Thank you for your post, the changes in the "shortcodes.php" from nggallery are working excellent in conjunction with jetpack. Great!

    Slideshow Latin America for example...Enjoy it ;)

  7. cnymike
    Member
    Posted 2 years ago #

    I have also been searching for a solution to this conflict that Jetpack has with NGG. Thank you for your code. I will attempt to use that code and see if it works for me.

  8. cnymike
    Member
    Posted 2 years ago #

    Yes, this fixed the conflict with Jetpack. I am a little confused why the NGG author Alwx Rabe can't simply make this modification in his code to resolve the conflict since Automatic apparently won't fix their code.

    The "problem" with this hack is that it will have to be reapplied every time there is a NGG update.

  9. Alex Rabe
    Member
    Posted 2 years ago #

    since Automatic apparently won't fix their code

    Why should not Automattic fix their code ? Do they have the sole right to use *any* kind of shortcode and other plugin authors should fix their plugins ?

  10. cnymike
    Member
    Posted 2 years ago #

    Well perhaps they should fix their code.

    But in a situation where they haven't, then I would think it would be helpful to all of us that use Jetpack and NextGen, to modify NextGen.

    But I guess that's your prerogative to leave it as it is and let users have to hack your code so that things work with Jetpack.

  11. Justin Tadlock
    Member
    Posted 2 years ago #

    Have you asked Automattic to make this modification to their plugin? What was their response?

  12. cnymike
    Member
    Posted 2 years ago #

    No I have not personally asked Automatic to modify their code.

    Previous posts regarding this issue have implied that Automatic was made aware of this issue though.

    I'd be happy to notify Automatic. What do you suggest as the most reliable way to do so, so that someone will actually acknowledge that there is an issue?

  13. cnymike
    Member
    Posted 2 years ago #

    And I apologize for my misspelling of Automattic.

  14. Justin Tadlock
    Member
    Posted 2 years ago #

    I'd start here:
    http://jetpack.me/support/

  15. cnymike
    Member
    Posted 2 years ago #

    I have in fact just emailed Automattic from their contact us form to notify them of this apparent conflict between NextGen and Jetpack.

    I have also used the link that Justin Tadlock provided to contact Jetpack support directly.

    Anxiously awaiting a reply .

  16. Alex Rabe
    Member
    Posted 2 years ago #

    My two cent :

    Goto slide.php in JetPack :
    http://plugins.trac.wordpress.org/browser/jetpack/trunk/modules/shortcodes/slide.php

    change ( or remove )
    add_shortcode( 'slideshow', 'slideshow_shortcode' );
    to
    add_shortcode( 'wpslideshow', 'slideshow_shortcode' );

    So you can fix this on both sides, maybe this fix is easier (note didn't tested it)

  17. cnymike
    Member
    Posted 2 years ago #

    Yes, it is slightly easier. (I did not test it either.) However, as with the NextGen hack, it will also be overwritten during any subsequent Jetpack update until a permanent fix is implemented.

    So now we have two hacks, one that works and one that -may- work from which to choose so that we can temporarily fix the problem.

    It's a start.

  18. cnymike
    Member
    Posted 2 years ago #

    Good news. Here is the response I got from Jetpack support.

    "Thanks for letting us know about this conflict.  We will include a fix
    for this in the next version of Jetpack, which will probably come out
    in a few weeks.

    In the meantime, you can have Jetpack active without loading Jetpack's
    shortcodes.  Install and Activate Jetpack, then go to your blog's
    admin -> Jetpack and click the "Learn More" button on the Shortcodes
    box.  Then click the "Deactivate" button that appears.

    Obviously, that's not an ideal solution since it disables *all* of
    Jetpack's shortcodes, not just the conflicting one."

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic