Changeset 13614 for trunk/src/bp-core/classes/class-bp-admin.php
- Timestamp:
- 10/19/2023 11:34:45 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-admin.php
r13595 r13614 304 304 $this->submenu_pages['settings']['bp-settings'] = $bp_settings_page; 305 305 $hooks[] = $bp_settings_page; 306 307 // Admin notifications. 308 $bp_admin_notifications = add_submenu_page( 309 $this->settings_page, 310 __( 'BuddyPress Admin Notifications', 'buddypress' ), 311 __( 'BuddyPress Admin Notifications', 'buddypress' ), 312 $this->capability, 313 'bp-admin-notifications', 314 array( $this, 'admin_notifications' ) 315 ); 316 317 $this->submenu_pages['settings']['bp-admin-notifications'] = $bp_admin_notifications; 318 $hooks[] = $bp_admin_notifications; 306 319 307 320 // Credits. … … 642 655 643 656 // Settings pages. 644 remove_submenu_page( $this->settings_page, 'bp-rewrites' ); 645 remove_submenu_page( $this->settings_page, 'bp-settings' ); 646 remove_submenu_page( $this->settings_page, 'bp-credits' ); 657 remove_submenu_page( $this->settings_page, 'bp-rewrites' ); 658 remove_submenu_page( $this->settings_page, 'bp-settings' ); 659 remove_submenu_page( $this->settings_page, 'bp-credits' ); 660 remove_submenu_page( $this->settings_page, 'bp-admin-notifications' ); 647 661 648 662 // Network Admin Tools. … … 1556 1570 */ 1557 1571 public function display_addons_table() { 1558 $notice_id = 'bp100-welcome-addons';1559 $dismissed = bp_get_option( "bp-dismissed-notice-{$notice_id}", false );1560 1561 if ( ! $dismissed ) {1562 // Enqueue the Script to Ajax Dismiss an Admin notice.1563 wp_enqueue_script( 'bp-dismissible-admin-notices' );1564 1565 ?>1566 <div class="bp-welcome-panel bp-notice-container">1567 <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>1568 <div class="bp-welcome-panel-content">1569 <h2><span class="bp-badge"></span> <?php esc_html_e( 'Hello BuddyPress Add-ons!', 'buddypress' ); ?></h2>1570 <p class="about-description">1571 <?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' ); ?>1572 <?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' ); ?>1573 </p>1574 </div>1575 </div>1576 <?php1577 }1578 1579 1572 if ( isset( $_GET['show'] ) && 'bp-classic' === $_GET['show'] ) { 1580 1573 wp_add_inline_script( … … 1592 1585 } 1593 1586 1587 if ( isset( $_GET['n'] ) && $_GET['n'] ) { 1588 $notification_id = sanitize_text_field( wp_unslash( $_GET['n'] ) ); 1589 bp_core_dismiss_admin_notification( $notification_id ); 1590 } 1591 1594 1592 // Display the "buddypress" favorites. 1595 1593 display_plugins_table(); 1596 1594 } 1595 1596 /** 1597 * Display the Admin Notifications screen. 1598 * 1599 * @since 11.4.0 1600 */ 1601 public function admin_notifications() { 1602 bp_core_admin_tabbed_screen_header( __( 'BuddyPress Settings', 'buddypress' ), __( 'Notifications', 'buddypress' ) ); 1603 $notifications = bp_core_get_admin_notifications(); 1604 $class = ''; 1605 1606 if ( $notifications ) { 1607 wp_enqueue_script( 'bp-dismissible-admin-notices' ); 1608 $notifications = array_reverse( bp_sort_by_key( $notifications, 'version', 'num' ) ); 1609 $class = 'hide'; 1610 } 1611 ?> 1612 <div class="buddypress-body admin-notifications"> 1613 <table id="no-admin-notifications" class="form-table <?php echo sanitize_html_class( $class ); ?>" role="presentation"> 1614 <tbody> 1615 <tr><td><?php esc_html_e( 'No new Admin Notfications', 'buddypress' ); ?></td><tr> 1616 </tbody> 1617 </table> 1618 1619 <?php if ( $notifications ) : foreach ( $notifications as $notification ) : ?> 1620 <?php bp_core_admin_format_notifications( $notification ); ?> 1621 <?php endforeach; endif; ?> 1622 </div> 1623 <?php 1624 } 1597 1625 } 1598 1626 endif; // End class_exists check.
Note: See TracChangeset
for help on using the changeset viewer.