Changeset 13615 for branches/11.0/src/bp-core/classes/class-bp-admin.php
- Timestamp:
- 10/19/2023 11:52:53 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/11.0/src/bp-core/classes/class-bp-admin.php
r13613 r13615 298 298 $this->submenu_pages['settings']['bp-settings'] = $bp_settings_page; 299 299 $hooks[] = $bp_settings_page; 300 301 // Admin notifications. 302 $bp_admin_notifications = add_submenu_page( 303 $this->settings_page, 304 __( 'BuddyPress Admin Notifications', 'buddypress' ), 305 __( 'BuddyPress Admin Notifications', 'buddypress' ), 306 $this->capability, 307 'bp-admin-notifications', 308 array( $this, 'admin_notifications' ) 309 ); 310 311 $this->submenu_pages['settings']['bp-admin-notifications'] = $bp_admin_notifications; 312 $hooks[] = $bp_admin_notifications; 300 313 301 314 // Credits. … … 626 639 627 640 // Settings pages. 628 remove_submenu_page( $this->settings_page, 'bp-page-settings' ); 629 remove_submenu_page( $this->settings_page, 'bp-settings' ); 630 remove_submenu_page( $this->settings_page, 'bp-credits' ); 641 remove_submenu_page( $this->settings_page, 'bp-page-settings' ); 642 remove_submenu_page( $this->settings_page, 'bp-settings' ); 643 remove_submenu_page( $this->settings_page, 'bp-credits' ); 644 remove_submenu_page( $this->settings_page, 'bp-admin-notifications' ); 631 645 632 646 // Network Admin Tools. … … 1541 1555 */ 1542 1556 public function display_addons_table() { 1543 $notice_id = 'bp100-welcome-addons';1544 $dismissed = bp_get_option( "bp-dismissed-notice-{$notice_id}", false );1545 1546 if ( ! $dismissed ) {1547 // Enqueue the Script to Ajax Dismiss an Admin notice.1548 wp_enqueue_script( 'bp-dismissible-admin-notices' );1549 1550 ?>1551 <div class="bp-welcome-panel bp-notice-container">1552 <a class="bp-welcome-panel-close bp-is-dismissible" href="#" data-notice_id="<?php echo esc_attr( $notice_id ); ?>" aria-label="<?php esc_attr_e( 'Dismiss the welcome panel', 'buddypress' ); ?>"><?php esc_html_e( 'Dismiss', 'buddypress' ); ?></a>1553 <div class="bp-welcome-panel-content">1554 <h2><span class="bp-badge"></span> <?php esc_html_e( 'Hello BuddyPress Add-ons!', 'buddypress' ); ?></h2>1555 <p class="about-description">1556 <?php esc_html_e( 'Add-ons are features as Plugins or Blocks maintained by the BuddyPress development team & hosted on the WordPress.org plugins directory.', 'buddypress' ); ?>1557 <?php esc_html_e( 'Thanks to this new tab inside your Dashboard screen to add plugins, you’ll be able to find them faster and eventually contribute to beta features early to give the BuddyPress development team your feedbacks.', 'buddypress' ); ?>1558 </p>1559 </div>1560 </div>1561 <?php1562 }1563 1564 1557 if ( isset( $_GET['show'] ) && 'bp-classic' === $_GET['show'] ) { 1565 1558 wp_add_inline_script( … … 1577 1570 } 1578 1571 1572 if ( isset( $_GET['n'] ) && $_GET['n'] ) { 1573 $notification_id = sanitize_text_field( wp_unslash( $_GET['n'] ) ); 1574 bp_core_dismiss_admin_notification( $notification_id ); 1575 } 1576 1579 1577 // Display the "buddypress" favorites. 1580 1578 display_plugins_table(); 1581 1579 } 1580 1581 /** 1582 * Display the Admin Notifications screen. 1583 * 1584 * @since 11.4.0 1585 */ 1586 public function admin_notifications() { 1587 bp_core_admin_tabbed_screen_header( __( 'BuddyPress Settings', 'buddypress' ), __( 'Notifications', 'buddypress' ) ); 1588 $notifications = bp_core_get_admin_notifications(); 1589 $class = ''; 1590 1591 if ( $notifications ) { 1592 wp_enqueue_script( 'bp-dismissible-admin-notices' ); 1593 $notifications = array_reverse( bp_sort_by_key( $notifications, 'version', 'num' ) ); 1594 $class = 'hide'; 1595 } 1596 ?> 1597 <div class="buddypress-body admin-notifications"> 1598 <table id="no-admin-notifications" class="form-table <?php echo sanitize_html_class( $class ); ?>" role="presentation"> 1599 <tbody> 1600 <tr><td><?php esc_html_e( 'No new Admin Notfications', 'buddypress' ); ?></td><tr> 1601 </tbody> 1602 </table> 1603 1604 <?php if ( $notifications ) : foreach ( $notifications as $notification ) : ?> 1605 <?php bp_core_admin_format_notifications( $notification ); ?> 1606 <?php endforeach; endif; ?> 1607 </div> 1608 <?php 1609 } 1582 1610 } 1583 1611 endif; // End class_exists check.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)