Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’m afraid I couldn’t reproduce the problem on my end.

    Could you post a link to one of your galleries here, so I can have a look?

    If you want your site URL to remain private, you can also contact us via this contact form:
    https://jetpack.me/contact-support/

    I am using WordPress 4.3.1 and after the last Jetpack Update 3.8.2 all Tiled Galleries changed to other settings (use subnail) and do not work any more.

    Link to a sample:

    https://foto.eldirko.net/asien-street-fotografie/

    Thread Starter Dogmatic

    (@dogmatic)

    Ok, disabling the Enhanced Media Library plugin fixed the issue so it appears, that was the culprit.

    Hi Jeremy and others,

    It’s Nadia, Enhanced Media Library’s author. I am aware about the issue and searching for the best solution for it.

    I’d like to describe why EML breaks the Tiled Gallery and ask for advice.

    EML needs to enhance [gallery] shortcode to make it understand media taxonomies. It hooks into “post_gallery” to override it. Same the Tiles Galleries does, so only one of them succeeds.

    Actually EML doesn’t need to override the layout but the attachments request only. Now, the “layout” part of the EML’s code is just a copy from the WordPress core – gallery_shortcode().

    On the other hand, the Tiled Galeries also does not need to override the attachment request, it actually needs to change the layout only.

    I learned the Jetpack’s code, and I like how it separates “get_attachments” and “gallery_html”! I believe that the WordPress core must have such separation. In this case we would have 2 hooks, for the database request and for generating the layout. But it doesn’t for now.

    The solution I am developing now is that: I re-wrote EML’s “post_gallery”, it now calls 2 functions get_attachments() and get_layout(). get_attachments() is very similar to Jetpack’s one, just adds taxonomies to the request (and I will need to add more parameters in the future). Before get_layout() I added my own hook “eml_gallery_html” that allows other plugins to hook into gallery layout. Now I am writing a function for my users that will allow to “turn on” the Tiled Galleries for EML through this hook.

    What do you think about cases like that? Maybe in the nearest future the Jetpack, as much more popular plugin, could add the hook for changing the attachment request in its code? What do you think about suggestion for the WordPress core gallery_shortcode to separate the request and the layout generating? It is actually a must-have for the contemporary approach to the development.

    Thanks!
    -Nadia

    Same here: disabling the Enhanced Media Library plugin fixed the Problem.

    Would be great if its possible that both plugins work without problems.

    Hello users on the Enhanced Media Library,

    Please read the plugin’s FAQ My gallery behavior is strange | My ligthbox/carousel plugin no longer works. You can deactivate the gallery functionality only in a click without deactivating the whole plugin until we find out a solution.

    -Nadia

    Thanks a lot for this great Support!
    The solution is fine for me.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    @webbistro Thanks a lot for chiming in!

    I think you could open a core Trac ticket with your ideas, it sounds like something that could benefit WordPress!

    Hi Jeremy,

    I will do. Just need to finish an update for EML.

    One more thing. The fix for my plugin is ready, but it is somehow unnatural. It extends Jetpack_Tiled_Gallery to override gallery_output so that to remove some code from it.

    Can you please add a filter like jp_gallery_attachments to the next version of the JetPack? In order I was able to change Tiled Galleries attachments array.

    Thanks!
    -Nadia

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    @webbistro that’s actually something that’s been suggested by others in the past. I added a link to this thread in the original GitHub issue:
    https://github.com/Automattic/jetpack/issues/1844

    Feel free to comment there, or submit a Pull Request with what you have in mind!

    Thanks!

    Thanks Jeremy!

    But it’s about overriding the template, though adding that filter is great idea as well. EML does not need to override gallery template, it needs to override that place in the code where Jetpack queries attachments from database for its gallery template.

    Line 106 in /jetpack/modules/tiled-gallery/tiled-gallery.php:

    $attachments = $this->get_attachments();
    if ( empty( $attachments ) )
        return '';

    For me it needs to be:

    $attachments = apply_filters( 'jp_gallery_attachments', array(), $attr );
    
    if ( empty( $attachments ) ) {
        $attachments = $this->get_attachments();
    }
    
    if ( empty( $attachments ) )
        return '';

    or better simply:

    $attachments = apply_filters( 'jp_gallery_attachments', array(), $attr );

    in case you will add something like:

    add_filter( 'jp_gallery_attachments', array( $this, 'get_attachments' ), 10, 2 );

    It would be a salvation for EML for now.

    Thanks!
    -Nadia

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Oh, I see what you mean!

    Would you like to submit a Pull Request with that change?

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Thanks!

    Can’t wait for 3.9 launch ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Tiled Galleries’ is closed to new replies.