- Timestamp:
- 10/19/2023 11:52:53 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/11.0/src/bp-core/admin/bp-core-admin-functions.php
r13550 r13615 512 512 'name' => __( 'Pages', 'buddypress' ), 513 513 ), 514 ' 3' => array(514 '4' => array( 515 515 'id' => 'bp-credits', 516 516 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ), … … 518 518 ), 519 519 ); 520 521 if ( bp_core_get_unread_admin_notifications() || ( isset( $_GET['page'] ) && 'bp-admin-notifications' === $_GET['page'] ) ) { 522 $settings_tabs['3'] = array( 523 'id' => 'bp-admin-notifications', 524 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-admin-notifications' ), 'admin.php' ) ), 525 'name' => __( 'Notifications', 'buddypress' ), 526 ); 527 } 520 528 521 529 if ( ! $apply_filters ) { … … 1413 1421 */ 1414 1422 function bp_core_admin_notice_dismiss_callback() { 1415 if ( ! current_user_can( ' install_plugins' ) ) {1423 if ( ! current_user_can( 'manage_options' ) ) { 1416 1424 wp_send_json_error(); 1417 1425 } … … 1440 1448 } 1441 1449 1442 bp_ update_option( "bp-dismissed-notice-{$notice_id}", true);1450 bp_core_dismiss_admin_notification( $notice_id ); 1443 1451 1444 1452 wp_send_json_success(); … … 1512 1520 } 1513 1521 add_action( 'bp_init', 'bp_block_init_category_filter' ); 1522 1523 /** 1524 * Outputs an Admin Notification. 1525 * 1526 * @since 11.4.0 1527 * 1528 * @param object $notification An Admin Notification object. 1529 */ 1530 function bp_core_admin_format_notifications( $notification = null ) { 1531 if ( ! isset( $notification->id ) ) { 1532 return ''; 1533 } 1534 ?> 1535 <div class="bp-welcome-panel bp-notice-container"> 1536 <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> 1537 <div class="bp-welcome-panel-content"> 1538 <h2><span class="bp-version"><?php echo number_format_i18n( $notification->version, 1 ); ?></span> <?php echo esc_html( $notification->title ); ?></h2> 1539 <p class="about-description"> 1540 <?php echo wp_kses( $notification->content, array( 'a' => array( 'href' => true ), 'br' => array(), 'strong' => array() ) ); ?> 1541 </p> 1542 <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> 1543 </div> 1544 </div> 1545 <?php 1546 }
Note: See TracChangeset
for help on using the changeset viewer.