Changeset 6537 for trunk/src/includes/admin/tools/common.php
- Timestamp:
- 06/13/2017 05:30:47 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/tools/common.php
r6438 r6537 30 30 */ 31 31 function bbp_get_admin_repair_tool_run_url( $component = array() ) { 32 $tools = admin_url( 'tools.php' ); 33 $page = ( 'repair' === $component['type'] ) ? 'bbp-repair' : 'bbp-upgrade'; 34 $args = array( 'page' => $page, 'action' => 'run', 'checked' => array( $component['id'] ) ); 35 $url = add_query_arg( $args, $tools ); 36 $nonced = wp_nonce_url( $url, 'bbpress-do-counts' ); 32 33 // Page 34 $page = ( 'repair' === $component['type'] ) 35 ? 'bbp-repair' 36 : 'bbp-upgrade'; 37 38 // Arguments 39 $args = array( 40 'page' => $page, 41 'action' => 'run', 42 'checked' => array( $component['id'] 43 ) ); 44 45 // Url 46 $nonced = wp_nonce_url( add_query_arg( $args, admin_url( 'tools.php' ) ), 'bbpress-do-counts' ); 37 47 38 48 // Filter & return … … 176 186 177 187 // Filter & return 178 return apply_filters( 'bbp_get_admin_repair_tools', $tools, $type );188 return (array) apply_filters( 'bbp_get_admin_repair_tools', $tools, $type ); 179 189 } 180 190 … … 201 211 202 212 // Filter & return 203 return apply_filters( 'bbp_get_admin_repair_tool_registered_components', $retval );213 return (array) apply_filters( 'bbp_get_admin_repair_tool_registered_components', $retval ); 204 214 } 205 215 … … 364 374 // Search 365 375 if ( ! empty( $search ) ) { 366 if ( ! strstr( strtolower( $tool[' description'] ), strtolower( $search ) ) ) {376 if ( ! strstr( strtolower( $tool['title'] ), strtolower( $search ) ) ) { 367 377 continue; 368 378 } … … 373 383 'id' => sanitize_key( $id ), 374 384 'type' => $tool['type'], 385 'title' => $tool['title'], 375 386 'description' => $tool['description'], 376 387 'callback' => $tool['callback'], … … 412 423 413 424 // Filter & return 414 return apply_filters( 'bbp_get_admin_repair_tool_components', $links, $item );425 return (array) apply_filters( 'bbp_get_admin_repair_tool_components', $links, $item ); 415 426 } 416 427 … … 460 471 461 472 // Loop through tools and count overheads 462 foreach ( $tools as $ id => $tool ) {473 foreach ( $tools as $tool ) { 463 474 464 475 // Get the overhead level … … 480 491 // Default ticker 481 492 $i = 0; 493 494 // Sort 495 ksort( $overheads ); 482 496 483 497 // Loop through overheads and build filter … … 493 507 494 508 // Figure out separator and active class 495 $current = ! empty( $_GET['overhead'] ) && ( sanitize_key( $_GET['overhead'] ) === $key ) ? 'current' : ''; 509 $current = ! empty( $_GET['overhead'] ) && ( sanitize_key( $_GET['overhead'] ) === $key ) 510 ? 'current' 511 : ''; 496 512 497 513 // Counts to show … … 537 553 538 554 // Filter & return 539 return apply_filters( 'bbp_get_admin_repair_tool_overhead', $links, $item );540 } 555 return (array) apply_filters( 'bbp_get_admin_repair_tool_overhead', $links, $item ); 556 }
Note: See TracChangeset
for help on using the changeset viewer.