Changeset 6934 for trunk/src/includes/core/update.php
- Timestamp:
- 11/12/2019 05:12:14 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.