Hi Brajesh
Is it possible to change the link of the “view” choice in gallery, and make it to point directly the “edit” page ?
How can I do that?
Thank you so much
Corrado
Hi Corrado,
Thank you for the question.I am assuming it is for the gallery list page? You can do it by editing the gallery-loop.php template in your theme.
If it is for any other screen, Please link me to a screenshot and outline it.
Thank you
BrajeshHi Brajesh
Yes it is for the gallery list page but I’m not able to see where to change in my “loop-gallery” on the other end in the “mpp-gallery-template-tag.php” I’have this :$links [‘view’] = sprintf( ‘%3$s‘, mpp_get_gallery_permalink( $gallery ), esc_attr( $gallery->title ), __( ‘View’, ‘mediapress’ ) );
it is here I’have to change something?
Thank you so much!
CorradoHi Corrado,
Please put this in your bp-custom.php
add_filter( 'mpp_gallery_actions_links', function ( $links, $links_array, $gallery ) { if ( mpp_user_can_edit_gallery( $gallery->id, get_current_user_id() ) ) { $links_array['view'] = sprintf( '<a href="%1$s" title="' . __( 'Edit', 'mediapress' ) . '">%2$s</a>', mpp_get_gallery_edit_media_url( $gallery ), __( 'edit', 'mediapress' ) ); } return join( ' ', $links_array ); }, 10, 3 );
That will change it.
Regards
BrajeshHi Brajesh
Thank you so much for your code. I’ve tested it and it does the job of moving the “view” to “edit link as far I m in “Gallery” and as far as I copy the bp-custom.php to the plugin directory while beeing logged in. Unfortunately, once I go outn, the systems stops in such way that we cannot even access the login. It looks to me that the buddypress functions are jeopardized by the code you sent me.
Please help me…
Thanks
CorradoHi Corrado,
Thank you for the reply.I am sorry but I do not see any issue with the above code. It does not seem to have any effect on logged in/out for me.
Can you please recheck(Please make sure you copy the code from the forum and not from the email notification).
Regards
BrajeshThank you Brajesh,
I also cannot find any errors in your code, but it still does not work. If it can be useful information, I’ m using Buddypress with BP-NOUVEAU template together with WP-OCEAN theme.
The code works fine so far I’m inside the gallery list page. But when I try to go somewhere else the system stops.It is very frustrating….
Best regards
CorradoHi Brajesh
I solved it by putting your code directly in the php
Thanks a lot
Corrado
Hi Corrado,
Thank you for the reply.I am glad you have been able to use it and got it working.
Regards
Brajesh
The topic ‘ [Resolved] redirect the "view" tag in mediapress’ is closed to new replies.