Changeset 13614 for trunk/src/bp-core/admin/bp-core-admin-functions.php
- Timestamp:
- 10/19/2023 11:34:45 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-functions.php
r13586 r13614 505 505 'name' => __( 'Options', 'buddypress' ), 506 506 ), 507 ' 3' => array(507 '4' => array( 508 508 'id' => 'bp-credits', 509 509 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ), … … 517 517 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-rewrites' ), 'admin.php' ) ), 518 518 'name' => __( 'URLs', 'buddypress' ), 519 ); 520 } 521 522 if ( bp_core_get_unread_admin_notifications() || ( isset( $_GET['page'] ) && 'bp-admin-notifications' === $_GET['page'] ) ) { 523 $settings_tabs['3'] = array( 524 'id' => 'bp-admin-notifications', 525 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-admin-notifications' ), 'admin.php' ) ), 526 'name' => __( 'Notifications', 'buddypress' ), 519 527 ); 520 528 } … … 1450 1458 */ 1451 1459 function bp_core_admin_notice_dismiss_callback() { 1452 if ( ! current_user_can( ' install_plugins' ) ) {1460 if ( ! current_user_can( 'manage_options' ) ) { 1453 1461 wp_send_json_error(); 1454 1462 } … … 1477 1485 } 1478 1486 1479 bp_ update_option( "bp-dismissed-notice-{$notice_id}", true);1487 bp_core_dismiss_admin_notification( $notice_id ); 1480 1488 1481 1489 wp_send_json_success(); … … 1555 1563 } 1556 1564 add_action( 'bp_init', 'bp_block_init_category_filter' ); 1565 1566 /** 1567 * Outputs an Admin Notification. 1568 * 1569 * @since 11.4.0 1570 * 1571 * @param object $notification An Admin Notification object. 1572 */ 1573 function bp_core_admin_format_notifications( $notification = null ) { 1574 if ( ! isset( $notification->id ) ) { 1575 return ''; 1576 } 1577 ?> 1578 <div class="bp-welcome-panel bp-notice-container"> 1579 <a class="bp-welcome-panel-close bp-is-dismissible" href="#" data-notice_id="<?php echo esc_attr( $notification->id ); ?>" aria-label="<?php esc_attr_e( 'Dismiss the notification', 'buddypress' ); ?>"><?php esc_html_e( 'Dismiss', 'buddypress' ); ?></a> 1580 <div class="bp-welcome-panel-content"> 1581 <h2><span class="bp-version"><?php echo number_format_i18n( $notification->version, 1 ); ?></span> <?php echo esc_html( $notification->title ); ?></h2> 1582 <p class="about-description"> 1583 <?php echo wp_kses( $notification->content, array( 'a' => array( 'href' => true ), 'br' => array(), 'strong' => array() ) ); ?> 1584 </p> 1585 <div class="bp-admin-notification-action"><a href="<?php echo esc_url( $notification->href ); ?>" class="button button-primary"><?php echo esc_html( $notification->text ); ?></a></div> 1586 </div> 1587 </div> 1588 <?php 1589 }
Note: See TracChangeset
for help on using the changeset viewer.