Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Change setting’s delete-account slug

  • @johnrobertsonsquid

    Participant

    Hi,

    I’ve been trying to change the delete account slug under the settings tab. I can change the settings slug by using a constant but I have found no article/resource on how to change the settings/delete-account/ slug, I would like to achieve a settings/membership/ slug

Viewing 3 replies - 1 through 3 (of 3 total)
  • @danbp

    Participant

    Documentation for this is in bp-core-buddybar.php

    Some working examples for navigation (since 2.6) here.

    And here a working example for:

    1. remove Delete Account on user profile settings tab
    2. add a new sub-nav item for “Memberships” to Profile > Settings

    1 )

    function bpex_remove_profile_settings_sub_tab() {   
    	// remove Delete Account from Profile Settings
    	bp_core_remove_subnav_item( BP_SETTINGS_SLUG, 'delete-account' );
    }
    add_action( 'bp_actions', 'bpex_remove_profile_settings_sub_tab' );

    2 )

    function bpex_add_sub_nav_to_profile_settings() {
    global $bp;
    $parent_slug = 'settings';
    $child_slug = 'memberships';
    		
    		//Add subnav item 	 
    		bp_core_new_subnav_item( array( 
    			'name'			=> __( 'My Memberships', 'textdomain' ),
    			'slug'			=> $child_slug, 
    			'parent_url'		=> $bp->loggedin_user->domain . $parent_slug.'/', 
    			'parent_slug'		=> $parent_slug, 
    			'screen_function'	=> 'bpex_profile_membership_screen'
    		) );
    }
    
    		function bpex_profile_membership_screen() {	
    			add_action( 'bp_template_content', 'bpex_profile_membership_screen_content' );
    			bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    		}
    
    		function bpex_profile_membership_screen_content() {
    			do_action( 'my_membership_post' );
    		}
    add_action( 'bp_setup_nav', 'bpex_add_sub_nav_to_profile_settings', 100 );
    
    function bpex_membership_stuff() {
    echo 'Some stuff here ?'; ?>
    <h2>Lorem Ipsum for ever !</h2>
    <p>Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.</p>
    <?php
    }
    add_action( 'my_membership_post', 'bpex_membership_stuff' );

    Add this to bp-custom.php

    @johnrobertsonsquid

    Participant

    Hi @danbp,

    Thanks for you reply, I’ll try this and I’ll get back to you with the results.

    I really appreciate your help.

    Thanks,
    John

    @johnrobertsonsquid

    Participant

    Thanks @danbp, RIHANNA TOLD ME THIS WORK WORK WORK WORK WORK!

    I express gratitude for your help! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Change setting’s delete-account slug’ is closed to new replies.
Skip to toolbar