Changeset 13502 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 06/13/2023 02:50:47 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r13490 r13502 816 816 * 817 817 * @since 1.7.0 818 * 819 * @param array $components Components to create pages for. 820 * @param string $existing 'delete' if you want to delete existing page mappings 821 * and replace with new ones. Otherwise existing page mappings 822 * are kept, and the gaps filled in with new pages. Default: 'keep'. 823 */ 824 function bp_core_add_page_mappings( $components, $existing = 'keep' ) { 818 * @since 12.0.0 Adds the `$return_pages` parameter. 819 * 820 * @param array $components Components to create pages for. 821 * @param string $existing 'delete' if you want to delete existing page mappings 822 * and replace with new ones. Otherwise existing page mappings 823 * are kept, and the gaps filled in with new pages. Default: 'keep'. 824 * @param boolean $return_pages Whether to return the page mapping or not. 825 * @return void|array 826 */ 827 function bp_core_add_page_mappings( $components, $existing = 'keep', $return_pages = false ) { 825 828 826 829 // If no value is passed, there's nothing to do. … … 847 850 848 851 $page_titles = bp_core_get_directory_page_default_titles(); 852 if ( $return_pages ) { 853 // In this case the `$components` array uses Page titles as values. 854 $page_titles = bp_parse_args( $page_titles, $components ); 855 } 849 856 850 857 $pages_to_create = array(); … … 899 906 if ( ! bp_is_root_blog() ) { 900 907 restore_current_blog(); 908 } 909 910 if ( $return_pages ) { 911 return $pages; 901 912 } 902 913 }
Note: See TracChangeset
for help on using the changeset viewer.