Changeset 6897
- Timestamp:
- 01/29/2019 04:38:37 AM (6 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/assets/css/admin.css
r6893 r6897 623 623 width: 10%; 624 624 } 625 626 .nav-tab-wrapper a span.awaiting-mod { 627 display: inline-block; 628 vertical-align: top; 629 margin: 3px 0 0 1px; 630 padding: 0 5px; 631 min-width: 7px; 632 height: 17px; 633 border-radius: 11px; 634 background-color: #ca4a1f; 635 color: #fff; 636 font-size: 9px; 637 line-height: 17px; 638 text-align: center; 639 z-index: 26; 640 } -
trunk/src/includes/admin/classes/class-bbp-admin.php
r6896 r6897 169 169 add_action( 'bbp_admin_init', array( $this, 'hide_notices' ) ); 170 170 add_action( 'bbp_admin_notices', array( $this, 'output_notices' ) ); 171 172 /** Upgrades **********************************************************/ 173 174 add_action( 'bbp_admin_init', array( $this, 'add_upgrade_count' ) ); 171 175 172 176 /** Ajax **************************************************************/ … … 387 391 388 392 /** 393 * Maybe append the pending upgrade count to the "Tools" menu. 394 * 395 * @since 2.6.0 bbPress (r6896) 396 * 397 * @global menu $menu 398 */ 399 public function add_upgrade_count() { 400 global $menu; 401 402 foreach ( $menu as $menu_index => $menu_item ) { 403 $found = array_search( 'tools.php', $menu_item, true ); 404 405 if ( false !== $found ) { 406 $menu[ $menu_index ][ 0 ] = bbp_maybe_append_pending_upgrade_count( $menu[ $menu_index ][ 0 ] ); 407 continue; 408 } 409 } 410 } 411 412 /** 389 413 * Add the admin menus 390 414 * … … 424 448 add_management_page( 425 449 esc_html__( 'Forums', 'bbpress' ), 426 esc_html__( 'Forums', 'bbpress'),450 bbp_maybe_append_pending_upgrade_count( esc_html__( 'Forums', 'bbpress' ) ), 427 451 'bbp_tools_page', 428 452 'bbp-repair', -
trunk/src/includes/admin/tools.php
r6896 r6897 481 481 $tab_class = $is_current ? $active_class : $idle_class; 482 482 $tab_url = add_query_arg( array( 'page' => $tab['page'] ), admin_url( 'tools.php' ) ); 483 $tabs_html .= '<a href="' . esc_url( $tab_url ) . '" class="' . esc_attr( $tab_class ) . '">' . esc_html( $tab['name'] ) . '</a>'; 483 484 // Tab name is not escaped - may contain HTML 485 $tabs_html .= '<a href="' . esc_url( $tab_url ) . '" class="' . esc_attr( $tab_class ) . '">' . $tab['name'] . '</a>'; 484 486 } 485 487 … … 515 517 'func' => 'bbp_admin_upgrade_page', 516 518 'cap' => 'bbp_tools_upgrade_page', 517 'name' => esc_html__( 'Upgrade Forums', 'bbpress'),519 'name' => bbp_maybe_append_pending_upgrade_count( esc_html__( 'Upgrade Forums', 'bbpress' ) ), 518 520 519 521 // Deprecated 2.6.0 -
trunk/src/includes/core/update.php
r6896 r6897 531 531 532 532 // Maybe add upgrade ID to end of pending array 533 if ( ! isset( $pending[ $upgrade_id ]) ) {533 if ( false === array_search( $upgrade_id, $pending, true ) ) { 534 534 array_push( $pending, $upgrade_id ); 535 535 } … … 568 568 return delete_option( '_bbp_db_pending_upgrades' ); 569 569 } 570 571 /** 572 * Maybe append an upgrade count to a string 573 * 574 * @since 2.6.0 bbPress (r6896) 575 * 576 * @param string $string 577 * 578 * @return string 579 */ 580 function bbp_maybe_append_pending_upgrade_count( $string = '' ) { 581 582 // Look for an upgrade count 583 $count = bbp_get_pending_upgrade_count(); 584 585 // Append the count to the string 586 if ( ! empty( $count ) ) { 587 $suffix = ' <span class="awaiting-mod count-' . absint( $count ) . '"><span class="pending-count">' . bbp_number_format( $count ) . '</span></span>'; 588 $string = "{$string}{$suffix}"; 589 } 590 591 // Return the string, maybe with a count 592 return $string; 593 }
Note: See TracChangeset
for help on using the changeset viewer.