Changeset 13446 for trunk/src/bp-groups/bp-groups-functions.php
- Timestamp:
- 04/04/2023 01:06:03 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-functions.php
r13437 r13446 3836 3836 'position' => 10, 3837 3837 'item_css_id' => 'home', 3838 ), 3839 'activity' => array( 3840 'rewrite_id' => 'bp_group_read_activity', 3841 'slug' => 'activity', 3842 'name' => _x( 'Activity', 'Group read screen', 'buddypress' ), 3843 'screen_function' => 'groups_screen_group_activity', 3844 'position' => 11, 3845 'user_has_access' => false, 3846 'no_access_url' => '', 3847 'item_css_id' => 'activity', 3838 3848 ), 3839 3849 'request-membership' => array( … … 3980 3990 return $context_screens; 3981 3991 } 3992 3993 /** 3994 * Get single group's path chunks using an array of URL slugs. 3995 * 3996 * @since 12.0.0 3997 * 3998 * @param array $chunks An array of URL slugs. 3999 * @return array An array of BP Rewrites URL arguments. 4000 */ 4001 function bp_groups_get_path_chunks( $chunks = array(), $context = 'read' ) { 4002 $path_chunks = array(); 4003 $group_screens = bp_get_group_screens( $context ); 4004 4005 if ( 'read' === $context ) { 4006 $single_item_action = array_shift( $chunks ); 4007 if ( $single_item_action ) { 4008 if ( isset( $group_screens[ $single_item_action ]['rewrite_id'] ) ) { 4009 $item_action_rewrite_id = $group_screens[ $single_item_action ]['rewrite_id']; 4010 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'groups', $item_action_rewrite_id, $single_item_action ); 4011 } else { 4012 $path_chunks['single_item_action'] = $single_item_action; 4013 } 4014 } 4015 } 4016 4017 if ( $chunks ) { 4018 foreach ( $chunks as $chunk ) { 4019 if ( is_numeric( $chunk ) ) { 4020 $path_chunks['single_item_action_variables'][] = $chunk; 4021 } else { 4022 if ( isset( $group_screens[ $chunk ]['rewrite_id'] ) ) { 4023 $item_action_variable_rewrite_id = $group_screens[ $chunk ]['rewrite_id']; 4024 $path_chunks['single_item_action_variables'][] = bp_rewrites_get_slug( 'groups', $item_action_variable_rewrite_id, $chunk ); 4025 } else { 4026 $path_chunks['single_item_action_variables'][] = $chunk; 4027 } 4028 } 4029 } 4030 } 4031 4032 return $path_chunks; 4033 }
Note: See TracChangeset
for help on using the changeset viewer.