Search Results for 'bp_core_remove_nav_item'
-
Search Results
-
Topic: Moving Links around
Hello Everyone,
I am trying to move some links around from the main Nav to the sub nav ie:
sub of Profile
Privacy
SettingsSub of MyGroups
CreateI have added the following code to my themes function.php and it moves the links as I want, but the first part bp_core_remove_nav_item seems to disable the page load.
`function boone_remove_blogs_nav() {
bp_core_remove_nav_item( ‘privacy’ );
bp_core_remove_nav_item( ‘settings’ );
bp_core_remove_nav_item( ‘invite-anyone’ );
}
add_action( ‘bp_setup_nav’, ‘boone_remove_blogs_nav’, 15 );function bp_add_create_group_subnav() {
global $bp;
$groups_link = ‘/groups-2/’;
$settings_link = $bp->loggedin_user->domain ;/* Add the subnav items to the groups nav item */
if (function_exists(‘bp_core_new_subnav_item’)) {
bp_core_new_subnav_item( array(
‘name’ => __( ‘Create Clan’, ‘buddypress’ ),
‘slug’ => ‘create’,
‘parent_url’ => $groups_link,
‘parent_slug’ => $bp->groups->slug,
‘screen_function’ => ‘groups_screen_group_home’,
‘position’ => 40,
‘item_css_id’ => ‘home’ ) );bp_core_new_subnav_item( array(
‘name’ => __( ‘Settings’, ‘buddypress’ ),
‘slug’ => ‘settings’,
‘parent_url’ => $settings_link,
‘parent_slug’ => $bp->profile->slug,
‘screen_function’ => ‘xprofile_screen_edit_profile_mmc’,
‘position’ => 30,
‘item_css_id’ => ‘home’ ) );bp_core_new_subnav_item( array(
‘name’ => __( ‘Privacy’, ‘buddypress’ ),
‘slug’ => ‘privacy’,
‘parent_url’ => $settings_link,
‘parent_slug’ => $bp->profile->slug,
‘screen_function’ => ‘xprofile_screen_edit_profile_mmc’,
‘position’ => 30,
‘item_css_id’ => ‘home’ ) );}
}
add_action(‘groups_setup_nav’, ‘bp_add_create_group_subnav’);
`
I was wondering what I am doing wrong?thanks in advance.
Topic: Moving Links around
Hello all,
This question is strange but how do I move links from the main nav to the sub nav under a specific parent_slug. i have tried this and it works kinda, except when i remove the links the function stops. In my themes functions.php i added:`function boone_remove_blogs_nav() {
bp_core_remove_nav_item( ‘privacy’ );
bp_core_remove_nav_item( ‘settings’ );
bp_core_remove_nav_item( ‘invite-anyone’ );
}
add_action( ‘bp_setup_nav’, ‘boone_remove_blogs_nav’, 15 );function bp_add_create_group_subnav() {
global $bp;
$groups_link = ‘/groups-2/’;
$settings_link = $bp->loggedin_user->domain ;/* Add the subnav items to the groups nav item */
if (function_exists(‘bp_core_new_subnav_item’)) {
bp_core_new_subnav_item( array(
‘name’ => __( ‘Create Clan’, ‘buddypress’ ),
‘slug’ => ‘create’,
‘parent_url’ => $groups_link,
‘parent_slug’ => $bp->groups->slug,
‘screen_function’ => ‘groups_screen_group_home’,
‘position’ => 40,
‘item_css_id’ => ‘home’ ) );bp_core_new_subnav_item( array(
‘name’ => __( ‘Settings’, ‘buddypress’ ),
‘slug’ => ‘settings’,
‘parent_url’ => $settings_link,
‘parent_slug’ => $bp->profile->slug,
‘screen_function’ => ‘xprofile_screen_edit_profile_mmc’,
‘position’ => 30,
‘item_css_id’ => ‘home’ ) );bp_core_new_subnav_item( array(
‘name’ => __( ‘Privacy’, ‘buddypress’ ),
‘slug’ => ‘privacy’,
‘parent_url’ => $settings_link,
‘parent_slug’ => $bp->profile->slug,
‘screen_function’ => ‘xprofile_screen_edit_profile_mmc’,
‘position’ => 30,
‘item_css_id’ => ‘home’ ) );}
}
add_action(‘groups_setup_nav’, ‘bp_add_create_group_subnav’);
`I would like to create my links like this:
Main
Send Invitessub of Profile
Privacy
SettingsSub of MyGroups
Create a groupShort of changing core buddypressbp-activity.php, I haven’t been able to change the activity’s default_subnav_slug from Personal to Friends.
Does anyone have a clue?
I’m copied the whole bp_activity_setup_nav (from bp-activity.php) into a custom function inside the theme’s functions.php
function my_bp_activity_setup_nav {
global $bp;
bp_core_remove_nav_item(‘activity’);
bp_core_new_nav_item( array( ‘name’ => __( ‘Activity’, ‘buddypress’ ), ‘slug’ => $bp->activity->slug, ‘position’ => 10, ‘screen_function’ => ‘bp_activity_screen_friends’, ‘default_subnav_slug’ => ‘friends’, ‘item_css_id’ => $bp->activity->id ) );
// rest of original bp_activity_setup_nav but with subnav positions changed
}
add_action( ‘wp’, ‘my_bp_activity_setup_nav’);This did not work. I’m at a total lost because the changed subnav item positions in my_bp_activity_setup_nav() is reflected. Just not the default_subnav_slug / screen_function for Activity.
I need to remove “Following” and “Followers” from the Profile nav.
I can remove other links using the function below in bp-custom.php
But Follow links still appear.
I’ve tried various priority values.
Perhaps I am calling the wrong tag in the add_action ?
`
function sc_remove_nav_tabs() {
/* works great */
bp_core_remove_nav_item( ‘events’ );
bp_core_remove_nav_item( ‘friends’ );
bp_core_remove_subnav_item( ‘activity’, ‘friends’ );/* doesn’t work*/
bp_core_remove_nav_item( ‘followers’ );
bp_core_remove_nav_item( ‘following’ );
bp_core_remove_subnav_item( ‘activity’, ‘following’ );}
add_action( ‘bp_setup_nav’, ‘sc_remove_nav_tabs’, 15 );
//add_action( ‘xprofile_setup_nav’, ‘sc_remove_nav_tabs’ );
`Also tried, without success:
bp_core_remove_subnav_item( $bp->activity->slug, ‘following’ );Topic: How to modify subnav items
Is there any way to hide the subnav items without removing the items from the adminbar? A search gave me the following codes:
function boone_remove_blogs_nav() {
bp_core_remove_nav_item( ‘friends’ );
bp_core_remove_nav_item( ‘settings’ );
bp_core_remove_nav_item( ‘groups’ );
}
add_action( ‘bp_setup_nav’, ‘boone_remove_blogs_nav’, 15 );When I use this code I remove the items from the subnav and the adminbar. The user is no longer able to use the functions. The reason for asking this is that the subnav menus is also available on the adminbar on top of the page. It is not necessary to have same menu on several places on the page.
I have also problem removing the actions “Followers” and “Following”. It seems that these actions does not response to the code I use.
Thank you for helping me solve this problem!
Regards
Phuong