Changeset 13502 for trunk/src/bp-core/admin/bp-core-admin-functions.php
- Timestamp:
- 06/13/2023 02:50:47 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-functions.php
r13497 r13502 291 291 foreach ( $wp_page_components as $component ) { 292 292 if ( ! isset( $bp->pages->{$component['id']} ) ) { 293 $orphaned_components[ ] = $component['name'];293 $orphaned_components[ $component['id'] ] = $component['name']; 294 294 } 295 295 } 296 296 297 297 if ( ! empty( $orphaned_components ) ) { 298 $notice = sprintf( 298 $notice_type = 'error'; 299 $notice = sprintf( 299 300 // Translators: %s is the comma separated list of components needing a directory page. 300 301 __( 'The following active BuddyPress Components do not have associated BuddyPress Pages: %s.', 'buddypress' ), … … 302 303 ); 303 304 304 bp_core_add_admin_notice( $notice ); 305 if ( 'buddypress' === bp_core_get_directory_post_type() ) { 306 $pages = bp_core_add_page_mappings( $orphaned_components, 'keep', true ); 307 $orphaned_components = array_intersect_key( $orphaned_components, $pages ); 308 309 $notice_type = 'updated'; 310 $notice = sprintf( 311 // Translators: %s is the comma separated list of components needing a directory page. 312 __( 'A BuddyPress page has been added for the following active BuddyPress Components which did not have associated BuddyPress Pages yet: %s.', 'buddypress' ), 313 '<strong>' . implode( '</strong>, <strong>', array_map( 'esc_html', $orphaned_components ) ) . '</strong>' 314 ); 315 } 316 317 bp_core_add_admin_notice( $notice, $notice_type ); 305 318 } 306 319 … … 321 334 // If there are duplicates, post a message about them. 322 335 if ( ! empty( $dupe_names ) ) { 323 $notice = s sprintf(336 $notice = sprintf( 324 337 // Translators: %s is the list of directory pages associated to more than one component. 325 338 __( 'Each BuddyPress Component needs its own BuddyPress page. The following BuddyPress Pages have more than one component associated with them: %s.', 'buddypress' ), … … 327 340 ); 328 341 329 bp_core_add_admin_notice( $notice );342 bp_core_add_admin_notice( $notice, 'error' ); 330 343 } 331 344 }
Note: See TracChangeset
for help on using the changeset viewer.