Changeset 9609 for branches/2.2/src/bp-core/bp-core-functions.php
- Timestamp:
- 03/10/2015 03:24:04 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/src/bp-core/bp-core-functions.php
r9505 r9609 419 419 * @since BuddyPress (1.5.0) 420 420 * 421 * @param string $status 'active' to return only pages associated with active components, 'all' to return all saved 422 * pages. When running save routines, use 'all' to avoid removing data related to inactive 423 * components. Default: 'active'. 421 424 * @return array|string An array of page IDs, keyed by component names, or an 422 * empty string if the list is not found.423 */ 424 function bp_core_get_directory_page_ids( ) {425 * empty string if the list is not found. 426 */ 427 function bp_core_get_directory_page_ids( $status = 'active' ) { 425 428 $page_ids = bp_get_option( 'bp-pages' ); 426 429 … … 437 440 } 438 441 439 if ( ! bp_is_active( $component_name ) || 'trash' == get_post_status( $page_id ) ) { 442 // Trashed pages should not appear in results. 443 if ( 'trash' == get_post_status( $page_id ) ) { 444 unset( $page_ids[ $component_name ] ); 445 446 } 447 448 // Remove inactive component pages, if required. 449 if ( 'active' === $status && ! bp_is_active( $component_name ) ) { 440 450 unset( $page_ids[ $component_name ] ); 441 451 } … … 549 559 } 550 560 551 $pages = bp_core_get_directory_page_ids( );561 $pages = bp_core_get_directory_page_ids( 'all' ); 552 562 553 563 // Delete any existing pages … … 640 650 } 641 651 642 $page_ids = bp_core_get_directory_page_ids( );652 $page_ids = bp_core_get_directory_page_ids( 'all' ); 643 653 $component_name = array_search( $post_id, $page_ids ); 644 654 … … 746 756 } 747 757 748 $page_ids = array_merge( (array) $new_page_ids, (array) bp_core_get_directory_page_ids( ) );758 $page_ids = array_merge( (array) $new_page_ids, (array) bp_core_get_directory_page_ids( 'all' ) ); 749 759 bp_core_update_directory_page_ids( $page_ids ); 750 760 }
Note: See TracChangeset
for help on using the changeset viewer.