bp_customizer_nav_menus_get_items( array $items = array(), string $type = '', string $object = '', integer $page )
Populate BuddyPress user nav items for the customizer.
Description
Parameters
- $items
-
(Optional) The array of menu items.
Default value: array()
- $type
-
(Optional) The requested type.
Default value: ''
- $object
-
(Optional) The requested object name.
Default value: ''
- $page
-
(Required) The page num being requested.
Return
(array) The paginated BuddyPress user nav items.
Source
File: bp-core/bp-core-filters.php
825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 | function bp_customizer_nav_menus_get_items( $items = array (), $type = '' , $object = '' , $page = 0 ) { if ( 'bp_loggedin_nav' === $object ) { $bp_items = bp_nav_menu_get_loggedin_pages(); } elseif ( 'bp_loggedout_nav' === $object ) { $bp_items = bp_nav_menu_get_loggedout_pages(); } else { return $items ; } foreach ( $bp_items as $bp_item ) { $items [] = array ( 'id' => "bp-{$bp_item->post_excerpt}" , 'title' => html_entity_decode( $bp_item ->post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ), 'type' => $type , 'url' => esc_url_raw( $bp_item ->guid ), 'classes' => "bp-menu bp-{$bp_item->post_excerpt}-nav" , 'type_label' => __( 'Custom Link' , 'buddyboss' ), 'object' => $object , 'object_id' => -1, ); } return array_slice ( $items , 10 * $page , 10 ); } |
Changelog
Version | Description |
---|---|
BuddyPress 2.3.3 | 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.