BuddyDev

Search

[Resolved] Rename Gallery tab title in members navigation

  • Participant
    Lawlyet Leonardo on #10108

    Hello.. Just installed this great plugin and havent yet found an option to change the /mediapress slug and the title of the Gallery tab displayed in buddypress member’s profile page…

    I already found a way to change the default /mediapress slug in the documentation:

    define( ‘MPP_GALLERY_SLUG’, ‘galeria’);

    now, to rename the title of the Gallery tab in the member’s nav menu, I made this created this little snippet to put in my child theme’s functions.php file:

    function shibumi_rename_mediapress_profile_tab() {
    $nomegaleria = sprintf(__(‘Galeria <span>%d</span>’, ‘mediapress’), mpp_get_total_gallery_for_user());
    buddypress()->members->nav->edit_nav( array( ‘name’ => __( $nomegaleria, ‘mediapress’ ) ), ‘galeria’ );
    }
    add_action( ‘bp_actions’, ‘shibumi_rename_mediapress_profile_tab’ );

    Now I can have my custom title (Galeria) and keep showing the number of gallery’s in it…

    Would you guys have a better solution? I’m new to wordpress and php…

    Thanx 😀

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #10111

    Hi Lawlyet,
    Welcome to BuddyDev.

    Thank you for the kind words.

    Please avoid using code to change the label. It is not efficient.

    I will suggest translating the plugin(You can translate only the strings you want to change), That will be a better way.

    Please see translating plugin here

    https://buddydev.com/mediapress/topics/getting-started/translating/translating-mediapress-into-your-local-language/

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 38
    Beuza on #12893

    Hello Brajesh,

    Hope you are good! Happy new year!

    When i try to rename Gallery tab with your method it doesn’t work when WPML is activated.

    Do you know why?

    Beuza

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12954

    Hi Beuza,
    happy new year to you too.

    Let us keep this discussion on the new topic

    https://buddydev.com/support/forums/topic/mediapress-and-wpml/#post-12953

    Marking this as resolved/closed.

    Regards
    Brajesh

The topic ‘ [Resolved] Rename Gallery tab title in members navigation’ is closed to new replies.

This topic is: resolved