BuddyDev

Search

[Resolved] Delete image redirect

  • Participant
    Level: Initiated
    Posts: 18
    Jemma Tates on #2751

    Hi 🙂

    On the shortcode:

    [mpp-media type=’photo’ max=’10; component=’members’ component=members]

    Is it possible to not redirect the user to the mediapress user page when they click on delete on one of their gallery images – so they click delete (it would delete the image) and they would stay on the same page? Perhaps when you click delete it would just refresh the page instead?

    Thanks for any help!

    Jem

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #2757

    Hi Jem,
    Thank you for asking.
    I included some functionality in 1.0.3 to allow this. After you upgrade the plugin to 1.0.3, you can use the following code

    
    
    function mpp_custom_redirect_on_media_delete_url() {
    	return wp_get_referer();
    }
    add_filter( 'mpp_media_delete_redirect_url', 'mpp_custom_redirect_on_media_delete_url' );
    
    

    In your bp-custom.php to redirect to the previous page on media delete.

  • Participant
    Level: Initiated
    Posts: 18
    Jemma Tates on #2760

    Oh yes! Fantastic this works a treat 🙂

    I updated the plugin.. the lightbox on the image gallery from the shortcode still doesn’t work, will this be updated any time soon?

    Thanks so much – brilliant plugin & amazing support!

    Jem

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #2762

    Hi Jem,
    Thank you for confirming.

    I am sorry about the lightbox. It skipped me otherwise we might have added the support in the shortcode. It is still possible to enable it via code. I will experiment a little and post back today if that can be done via code until we add he support in shortcodes.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 18
    Jemma Tates on #2887

    Hi Brajesh,

    Any luck with finishing this code?

    Thanks Jem

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #2892

    Hi Jem,
    I looked at it but the javascript methods that we use to enable the lightbox are private. So, I can not write an addon to enable it from outside. I will be releasing n update on coming Wednesday and that will allow you to enable lightbox directly.

    Sorry about the inconvenience.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 18
    Jemma Tates on #2893

    That’s fantastic thanks for letting me know 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #2897

    Thank you Jem 🙂
    Will post back here after the update.

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #3003

    Hi Jem,
    Just wanted to give an update. I have added it in MediaPress. You can use the option lightbox=1 to enable lightbox in shortcode.
    https://github.com/buddydev/mediapress/commit/06938dace00a8f7b7567d69ba290cb8eee950216

    I will be pushing the new release after a few fixes, after that it will be available on wp.org repo too.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24257
    Brajesh Singh on #3054

    Hi,
    It is available on wp.org now. Please upgrade.

The topic ‘ [Resolved] Delete image redirect’ is closed to new replies.

This topic is: resolved