Changeset 13442 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 03/27/2023 06:19:06 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r13441 r13442 4882 4882 return (int) apply_filters( 'bp_get_post_type_site_id', $site_id ); 4883 4883 } 4884 4885 /** 4886 * Returns registered navigation items for all or a specific component. 4887 * 4888 * @since 12.0.0 4889 * 4890 * @param string $component The component ID. 4891 * @return array The list of registered navigation items. 4892 */ 4893 function bp_get_component_navigations( $component = '' ) { 4894 $args = array(); 4895 if ( $component ) { 4896 $args['id'] = $component; 4897 } 4898 4899 $components = bp_core_get_active_components( $args, 'objects' ); 4900 $navigations = array(); 4901 4902 foreach ( $components as $key_component => $component ) { 4903 if ( isset( $component->main_nav['rewrite_id'] ) ) { 4904 $navigations[ $key_component ]['main_nav'] = $component->main_nav; 4905 } 4906 4907 if ( isset( $component->sub_nav ) && is_array( $component->sub_nav ) && $component->sub_nav ) { 4908 $navigations[ $key_component ]['sub_nav'] = $component->sub_nav; 4909 } 4910 } 4911 4912 return $navigations; 4913 }
Note: See TracChangeset
for help on using the changeset viewer.