Changeset 13679
- Timestamp:
- 12/24/2023 04:34:15 AM (9 months ago)
- Location:
- branches/12.0/src/bp-core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/12.0/src/bp-core/admin/bp-core-admin-rewrites.php
r13675 r13679 39 39 } 40 40 41 $switched_to_root_blog = false; 42 43 // Make sure the current blog is set to the root blog. 44 if ( ! bp_is_root_blog() ) { 45 switch_to_blog( bp_get_root_blog_id() ); 46 $switched_to_root_blog = true; 47 } 48 41 49 $directory_pages = (array) bp_core_get_directory_pages(); 42 50 $current_page_slugs = wp_list_pluck( $directory_pages, 'slug', 'id' ); … … 96 104 if ( $reset_rewrites ) { 97 105 bp_delete_rewrite_rules(); 106 } 107 108 if ( $switched_to_root_blog ) { 109 restore_current_blog(); 98 110 } 99 111 -
branches/12.0/src/bp-core/bp-core-functions.php
r13648 r13679 776 776 777 777 // Set pages as standard class. 778 $pages = new stdClass; 778 $pages = new stdClass; 779 $switched_to_root_blog = false; 780 781 // Make sure the current blog is set to the root blog. 782 if ( ! bp_is_root_blog() && ! bp_is_multiblog_mode() ) { 783 switch_to_blog( bp_get_root_blog_id() ); 784 $switched_to_root_blog = true; 785 } 779 786 780 787 // Get pages and IDs. … … 816 823 } 817 824 } 825 } 826 827 if ( $switched_to_root_blog ) { 828 restore_current_blog(); 818 829 } 819 830 -
branches/12.0/src/bp-core/bp-core-rewrites.php
r13461 r13679 52 52 */ 53 53 function bp_delete_rewrite_rules() { 54 delete_option( 'rewrite_rules' );54 bp_delete_option( 'rewrite_rules' ); 55 55 } 56 56
Note: See TracChangeset
for help on using the changeset viewer.