BuddyDev

Search

[Resolved] How to Disable Automatic update of MediaPress Gallery Cover

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5677

    I want the image gallery cover to be the same all the time. Now it changes to the first image uploaded. How can I avoid that?

    • This topic was modified 5 years, 8 months ago by Brajesh Singh. Reason: Updating Titlte
    • This topic was modified 5 years, 8 months ago by Brajesh Singh. Reason: Updating Title/Description
  • Keymaster
    (BuddyDev Team)
    Posts: 21083
    Brajesh Singh on #5679

    Hi Jaume,
    Can you please post a screenshot? Do you mean the Gallery cover image?

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5682

    Yes, the gallery cover image. How can I upload an image here?

  • Keymaster
    (BuddyDev Team)
    Posts: 21083
    Brajesh Singh on #5685

    Hi Jaume,
    Please use any 3rd party service like imgur etc.

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5687

    The images are here: http://imgur.com/a/raN8A

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5698

    What/Where is the function that creates the new gallery cover image on image upload to block it and keep the original gallery cover image used on gallery creation, please? How do I stop it from changing the image?

  • Keymaster
    (BuddyDev Team)
    Posts: 21083
    Brajesh Singh on #5699

    Hi Jaume,
    At the moment I haven’t provided a hook to stop it. You can see the actual implementation here

    https://github.com/buddydev/mediapress/blob/master/core/gallery/mpp-gallery-cover-templates.php#L32

    When a cover image is fetched for the gallery and if It does not exist, we check if the gallery is of type photo and then set the first image as the cover.

    I am adding a hook for future today, for now, You will need to remove that chunk of code.

    Hope that helps.

  • Keymaster
    (BuddyDev Team)
    Posts: 21083
    Brajesh Singh on #5700

    For future, I have added filter ‘mpp_gallery_auto_update_cover’. It can be easily disabled like this

    
    add_filter('mpp_gallery_auto_update_cover', '__return_false' );
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 21083
    Brajesh Singh on #5702

    I have updated the title of the topic to reflect the intention correctly.

  • Participant
    Level: Enlightened
    Posts: 40
    Jaume Aragay on #5703

    Great. Thanks. I’ll add the filter to my functions file for future releases and tweak the code by now! 😉

The topic ‘ [Resolved] How to Disable Automatic update of MediaPress Gallery Cover’ is closed to new replies.

This topic is: resolved