Changeset 13514 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 07/12/2023 03:38:26 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r13503 r13514 851 851 $page_titles = bp_core_get_directory_page_default_titles(); 852 852 if ( $return_pages ) { 853 $components_title = wp_list_pluck( $components, 'title' ); 854 if ( ! $components_title ) { 855 $components_title = $components; 856 } 857 853 858 // In this case the `$components` array uses Page titles as values. 854 $page_titles = bp_parse_args( $page_titles, $components );859 $page_titles = bp_parse_args( $page_titles, $components_title ); 855 860 } 856 861 … … 883 888 884 889 // Create the pages. 885 foreach ( $pages_to_create as $component_name => $page_ name ) {890 foreach ( $pages_to_create as $component_name => $page_title ) { 886 891 $existing_id = bp_core_get_directory_page_id( $component_name ); 887 892 … … 890 895 $pages[ $component_name ] = (int) $existing_id; 891 896 } else { 892 $p ages[ $component_name ] = wp_insert_post(array(897 $postarr = array( 893 898 'comment_status' => 'closed', 894 899 'ping_status' => 'closed', 895 900 'post_status' => 'publish', 896 'post_title' => $page_ name,901 'post_title' => $page_title, 897 902 'post_type' => bp_core_get_directory_post_type(), 898 ) ); 903 ); 904 905 if ( isset( $components[ $component_name ]['name'] ) ) { 906 $postarr['post_name'] = $components[ $component_name ]['name']; 907 } 908 909 $pages[ $component_name ] = wp_insert_post( $postarr ); 899 910 } 900 911 }
Note: See TracChangeset
for help on using the changeset viewer.