Changeset 13532
- Timestamp:
- 07/28/2023 04:15:13 PM (3 years ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 2 edited
-
bp-core-functions.php (modified) (2 diffs)
-
classes/class-bp-core.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r13520 r13532 670 670 671 671 /** 672 * Get the component ID corresponding to a directory page ID. 673 * 674 * @since 12.0.0 675 * 676 * @param int $page_id The ID of the directory page associated with the component. 677 * @return int|false The slug representing the component. False if none is found. 678 */ 679 function bp_core_get_component_from_directory_page_id( $page_id = 0 ) { 680 $bp_pages = bp_core_get_directory_page_ids( 'all' ); 681 682 $component = false; 683 foreach ( $bp_pages as $component_id => $p_id) { 684 if ( $page_id === $p_id ) { 685 $component = $component_id; 686 break; 687 } 688 } 689 690 return $component; 691 } 692 693 /** 672 694 * Store the list of BP directory pages in the appropriate meta table. 673 695 * … … 970 992 array( 971 993 'post__not_in' => array( $post_ID ), 972 'post_status' => array( 'publish', 'bp_restricted'),994 'post_status' => bp_core_get_directory_pages_stati(), 973 995 'post_type' => array( 'buddypress', 'page' ), 974 996 ) -
trunk/src/bp-core/classes/class-bp-core.php
r13507 r13532 399 399 400 400 /** 401 * Set up the component post statuses.402 *403 * @since 12.0.0404 */405 public function register_post_statuses() {406 register_post_status(407 'bp_restricted',408 array(409 'label' => _x( 'Restricted to members', '`buddypress` post type post status', 'buddypress' ),410 'public' => false,411 'internal' => true,412 )413 );414 415 parent::register_post_statuses();416 }417 418 /**419 401 * Parse the WP_Query and eventually set the BP Search mechanism. 420 402 *
Note: See TracChangeset
for help on using the changeset viewer.