Changeset 6934
- Timestamp:
- 11/12/2019 05:12:14 PM (5 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/tools.php
r6925 r6934 521 521 'func' => 'bbp_admin_repair_page', 522 522 'cap' => 'bbp_tools_repair_page', 523 'name' => esc_html__( 'Repair Forums', 'bbpress' ),523 'name' => bbp_maybe_append_pending_upgrade_count( esc_html__( 'Repair Forums', 'bbpress' ), 'repair' ), 524 524 525 525 // Deprecated 2.6.0 … … 530 530 'func' => 'bbp_admin_upgrade_page', 531 531 'cap' => 'bbp_tools_upgrade_page', 532 'name' => bbp_maybe_append_pending_upgrade_count( esc_html__( 'Upgrade Forums', 'bbpress' ) ),532 'name' => bbp_maybe_append_pending_upgrade_count( esc_html__( 'Upgrade Forums', 'bbpress' ), 'upgrade' ), 533 533 534 534 // Deprecated 2.6.0 -
trunk/src/includes/admin/tools/common.php
r6933 r6934 881 881 } 882 882 883 // Get the type of tool 884 $type = bbp_get_admin_repair_tool_page_id(); 885 883 886 // Count the tools 884 $tools = bbp_get_admin_repair_tools( bbp_get_admin_repair_tool_page_id());887 $tools = bbp_get_admin_repair_tools( $type ); 885 888 886 889 // Get the tools URL … … 888 891 889 892 // Get pending upgrades 890 $pending = bbp_get_pending_upgrades( );893 $pending = bbp_get_pending_upgrades( $type ); 891 894 892 895 // Get the current status, if any -
trunk/src/includes/admin/tools/repair.php
r6933 r6934 48 48 <p class="description"><?php esc_html_e( 'Some of these tools create substantial database overhead. Use caution when running more than 1 repair at a time.', 'bbpress' ); ?></p> 49 49 50 <?php bbp_admin_repair_tool_ overhead_filters(); ?>50 <?php bbp_admin_repair_tool_status_filters(); ?> 51 51 52 52 <form class="settings" method="get" action=""> -
trunk/src/includes/core/update.php
r6926 r6934 501 501 * @since 2.6.0 bbPress (r6895) 502 502 * 503 * @param string $type Type of pending upgrades (upgrade|repair|empty) 504 * 503 505 * @return int 504 506 */ 505 function bbp_get_pending_upgrade_count( ) {506 return count( (array) bbp_get_pending_upgrades( ) );507 function bbp_get_pending_upgrade_count( $type = '' ) { 508 return count( (array) bbp_get_pending_upgrades( $type ) ); 507 509 } 508 510 … … 512 514 * @since 2.6.0 bbPress (r6895) 513 515 * 516 * @param string $type Type of pending upgrades (upgrade|repair|empty) 517 * 514 518 * @return array 515 519 */ 516 function bbp_get_pending_upgrades() { 517 return (array) get_option( '_bbp_db_pending_upgrades', array() ); 520 function bbp_get_pending_upgrades( $type = '' ) { 521 522 // Get the pending upgrades 523 $retval = (array) get_option( '_bbp_db_pending_upgrades', array() ); 524 525 // Looking for a specific type? 526 if ( ! empty( $type ) ) { 527 $tools = bbp_get_admin_repair_tools( $type ); 528 $plucked = array_keys( wp_list_pluck( $tools, 'type' ) ); 529 $retval = array_intersect( $retval, $plucked ); 530 } 531 532 return (array) $retval; 518 533 } 519 534 … … 577 592 * @since 2.6.0 bbPress (r6896) 578 593 * 579 * @param string $string 594 * @param string $string Text to append count to 595 * @param string $type Type of pending upgrades (upgrade|repair|empty) 580 596 * 581 597 * @return string 582 598 */ 583 function bbp_maybe_append_pending_upgrade_count( $string = '' ) {599 function bbp_maybe_append_pending_upgrade_count( $string = '', $type = '' ) { 584 600 585 601 // Look for an upgrade count 586 $count = bbp_get_pending_upgrade_count( );602 $count = bbp_get_pending_upgrade_count( $type ); 587 603 588 604 // Append the count to the string
Note: See TracChangeset
for help on using the changeset viewer.