Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Profile settings url

  • @fernon

    Participant

    Hi everyone,

    Where can I change the url of the profile settings tab? I’ve searched everywhere but I can’t find it. Instead of /settings I would like to give it another URL.

    Thanks a lot!

Viewing 22 replies - 1 through 22 (of 22 total)
  • @chouf1

    Participant

    @fernon,

    add this to bp-custom.php  /plugins/bp-custom.php (i you don’t such file you have to create it first)
    define( 'BP_SETTINGS_SLUG', 'settings' );

    //Change "settings" to what you want.

    You can read here: https://codex.buddypress.org/developer/customizing/customizing-labels-messages-and-urls/

    @fernon

    Participant

    @Chouf1 thanks a lot!! Is it possible to change it to notifications? I want to link that menu item to the notifications

    @chouf1

    Participant

    Everything is possible if you know what you want.  But you must explain that clearly. 😉

    @fernon

    Participant

    @Chouf1 Haha sorry mate. What i mean is that I want the settings tab in the profile navigation to be linked to /notifications instead of /general. Thats because I disabled the general tab where people can edit their email and change their passwords.

    If you click on the settings tab a 404 error page shows up, because the page doesn’t exist. So I thought lets link that page to the notifications straight away.(since that is still possible)

    Hope its clear enough.

    THanks!

    @chouf1

    Participant

    Can you pastebin the code you already made for this ?

    @fernon

    Participant

    @Chouf1 Sure! I put this in my functions.php

    //Remove Settings->Notifications SubMenu
    function remove_general_subnav(){
    global $bp;
    if ( $bp->current_component == $bp->settings->slug ) {
    bp_core_remove_subnav_item($bp->settings->slug, ‘general’);
    }
    }
    add_action( ‘wp’, ‘remove_general_subnav’, 2 );

    @chouf1

    Participant

    @fernon,

    notifications menu item is subnav dependant and a bit complicated to set.

    Anyway, here are 2 functions to make this work a little better as your function.
    One removes the setting page to avoid the 404 error
    And the other remove the “general > settings” submenu.

    Will see this week-end how to move “notifications” from sub to top level in the my_account group menu. Also how to get rid of the “settings” menu on the buddy navbar showing above the content.

    http://bp-fr.net/BuddyBin/?82cf558c7fc5cc10#/oXAizh+nvupA3fVOfRQ2E9WvEcLyTxRM/f+rv5+DEQ=

    Give a try and feedback too ! 😉

    @fernon

    Participant

    Hi @chouf1 Thanks!!!!! Ill wait for your response about the notifications link.

    @chouf1

    Participant

    @fernon,

    here a better code for doing what you need. Code is commented, so i hope you understand how it works

    http://bp-fr.net/BuddyBin/?92674aed1b1c6efc#cEK0nMFiknQS0ozXwkKTOGqANlnGLuQdDIsxLi3cr7E=

     

    @fernon

    Participant

    @chouf1 It works! Thanks for the effort, I really appreciate it. How can I also add the link to the profile buddypress navigation? It only shows up in the toolbar now.

    @chouf1

    Participant

    @fernon

    Participant

    @Chouf1 Im so sorry mate! I ment in the general navigation menu. A new item called settings.

    @chouf1

    Participant

    @fernon

    Participant

    @Chouf1 Yes it works! Where do I change the css? When I give it another ID in the php it doesn’t work. Example: Your code says css_id= “notif” And in my css I put in #notif, but that doesn’t seem to work.

    @chouf1

    Participant

    @fernon,

    as is, no, it doesn’t work. 😉

    you have to learn a bit on your own. Geting a style element ID is ALWAYS written in the page source code, not absolutly in the function.

     

    @fernon

    Participant

    Ok thanks mate!

    @fernon

    Participant

    @Chouf1 Sorry, last question. I can’t figure out where the css ID is coming from. I tried to look it up with firebug but the given ID there doesn’t seem to work. Where is the ID created? Not in the function right? (Since I already tried that)

    Thanks

    @chouf1

    Participant

    @fernon

    sorry there is a little error in my code !

    replace ‘css_id’      => ‘notif’,
    by     ‘item_css_id’      => ‘notif’,

    css test to use in child theme styles.css
    li#notif-personal-li {
    font-weight: bold!important;
    }

    @fernon

    Participant

    ah thats why. Thank you!

    @fernon

    Participant

    @chouf1 I noticed something. The settings link is visible on every profile page.

    So if you’re logged in as user 1, you’re able to see the settings link on user 2 his account. Is it possible to show it only on your own account and hide it on other people their account? User 2 is not allowed to see the settings link on user 1 his profile page. Only on his own profile page.

    @chouf1

    Participant

    @fernon

    try this

    if (bp_is_my_profile( $userid )):
    bp_core_new_nav_item(array(

    bla bla code
    ) );
    endif;

    @fernon

    Participant

    @chouf1 Where should I start en end this code exactly? Because when I end the code with the ) );
    endif; The line seems to be corrupt.

    I started the whole function with:

    if (bp_is_my_profile( $userid )):
    bp_core_new_nav_item(array(

    “the whole piece of code you gave me”

    ) );
    endif;

    Is this correct?

Viewing 22 replies - 1 through 22 (of 22 total)
  • The topic ‘[Resolved] Profile settings url’ is closed to new replies.
Skip to toolbar