bp_core_reset_subnav_items( string $parent_slug, string $component = 'members' )
Clear all subnav items from a specific nav item.
Description
Parameters
- $parent_slug
-
(Required) The slug of the parent navigation item.
- $component
-
(Optional) The component the navigation is attached to. Defaults to 'members'.
Default value: 'members'
Source
File: bp-core/bp-core-buddybar.php
893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 | function bp_core_reset_subnav_items( $parent_slug , $component = 'members' ) { $bp = buddypress(); if ( ! isset( $bp ->{ $component }->nav ) ) { return ; } $subnav_items = $bp ->{ $component }->nav->get_secondary( array ( 'parent_slug' => $parent_slug ), false ); if ( ! $subnav_items ) { return ; } foreach ( $subnav_items as $subnav_item ) { $bp ->{ $component }->nav->delete_nav( $subnav_item ->slug, $parent_slug ); } } |
Changelog
Version | Description |
---|---|
BuddyPress 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.