Changeset 13123 for trunk/src/bp-core/admin/bp-core-admin-actions.php
- Timestamp:
- 10/09/2021 06:10:51 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-actions.php
r12606 r13123 60 60 add_action( 'bp_admin_menu', 'bp_admin_separator' ); 61 61 62 // Add a filter to include BP Components directory pages display states. 63 add_filter( 'display_post_states', 'bp_admin_display_directory_states', 10, 2 ); 64 62 65 /** 63 66 * When a new site is created in a multisite installation, run the activation … … 235 238 do_action( 'bp_register_admin_settings' ); 236 239 } 240 241 /** 242 * Dedicated filter to inform about BP components directory page states. 243 * 244 * @since 10.0.0 245 * 246 * @param string[] $post_states An array of post display states. 247 * @param WP_Post $post The current post object. 248 */ 249 function bp_admin_display_directory_states( $post_states = array(), $post = null ) { 250 /** 251 * Filter here to add BP Directory pages. 252 * 253 * Used internaly by BP_Component->admin_directory_states(). Please use the dynamic 254 * filter in BP_Component->admin_directory_states() to edit the directory state 255 * according to the component's ID. 256 * 257 * @since 10.0.0 258 * 259 * @param array $value An empty array. 260 * @param WP_Post $post The current post object. 261 */ 262 $directory_page_states = apply_filters( 'bp_admin_display_directory_states', array(), $post ); 263 264 if ( $directory_page_states ) { 265 $post_states = array_merge( $post_states, $directory_page_states ); 266 } 267 268 return $post_states; 269 }
Note: See TracChangeset
for help on using the changeset viewer.