Changeset 13443 for trunk/src/bp-members/bp-members-functions.php
- Timestamp:
- 03/31/2023 05:26:39 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-functions.php
r13436 r13443 137 137 */ 138 138 return apply_filters( 'bp_core_get_users', $retval, $r ); 139 } 140 141 /** 142 * Get members path chunks using an array of URL slugs. 143 * 144 * @since 12.0.0 145 * 146 * @param array $chunks An array of URL slugs. 147 * @return array An array of BP Rewrites URL arguments. 148 */ 149 function bp_members_get_path_chunks( $chunks = array() ) { 150 $path_chunks = array(); 151 152 $single_item_component = array_shift( $chunks ); 153 $item_component_rewrite_id_suffix = ''; 154 if ( $single_item_component ) { 155 $item_component_rewrite_id_suffix = str_replace( '-', '_', $single_item_component ); 156 $path_chunks['single_item_component'] = bp_rewrites_get_slug( 'members', 'member_' . $item_component_rewrite_id_suffix, $single_item_component ); 157 } 158 159 $single_item_action = array_shift( $chunks ); 160 $item_action_rewrite_id_suffix = ''; 161 if ( $single_item_action ) { 162 $item_action_rewrite_id_suffix = str_replace( '-', '_', $single_item_action ); 163 $path_chunks['single_item_action'] = bp_rewrites_get_slug( 'members', 'member_' . $item_component_rewrite_id_suffix . '_' . $item_action_rewrite_id_suffix, $single_item_action ); 164 } 165 166 if ( $chunks && $item_component_rewrite_id_suffix && $item_component_rewrite_id_suffix ) { 167 foreach ( $chunks as $chunk ) { 168 $item_action_variable_rewrite_id_suffix = str_replace( '-', '_', $chunk ); 169 $path_chunks['single_item_action_variables'][] = bp_rewrites_get_slug( 'members', 'member_' . $item_component_rewrite_id_suffix . '_' . $item_action_rewrite_id_suffix . '_' . $item_action_variable_rewrite_id_suffix, $chunk ); 170 } 171 } 172 173 return $path_chunks; 139 174 } 140 175
Note: See TracChangeset
for help on using the changeset viewer.