| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * bbPress Admin Tools Page. | |
| 4 | + * bbPress Admin Tools Page | |
| 5 | 5 | * |
| 6 | 6 | * @package bbPress |
| 7 | 7 | * @subpackage Administration |
| 8 | 8 | */ |
| @@ -10,13 +10,11 @@ | ||
| 10 | 10 | // Exit if accessed directly |
| 11 | 11 | defined( 'ABSPATH' ) || exit; |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * Output a bbPress specific tools box. | |
| 14 | + * Output a bbPress specific tools box | |
| 15 | 15 | * |
| 16 | 16 | * @since 2.6.0 bbPress (r6273) |
| 17 | - * | |
| 18 | - * @return void | |
| 19 | 17 | */ |
| 20 | 18 | function bbp_admin_tools_box() { |
| 21 | 19 | |
| 22 | 20 | // Bail if user cannot access tools page |
| @@ -54,14 +52,14 @@ | ||
| 54 | 52 | <?php |
| 55 | 53 | } |
| 56 | 54 | |
| 57 | 55 | /** |
| 58 | - * Register an admin area repair tool. | |
| 56 | + * Register an admin area repair tool | |
| 59 | 57 | * |
| 60 | 58 | * @since 2.6.0 bbPress (r5885) |
| 61 | 59 | * |
| 62 | 60 | * @param array $args |
| 63 | - * @return void | |
| 61 | + * @return | |
| 64 | 62 | */ |
| 65 | 63 | function bbp_register_repair_tool( $args = array() ) { |
| 66 | 64 | |
| 67 | 65 | // Parse arguments |
| @@ -107,9 +105,9 @@ | ||
| 107 | 105 | ); |
| 108 | 106 | } |
| 109 | 107 | |
| 110 | 108 | /** |
| 111 | - * Register the default repair tools. | |
| 109 | + * Register the default repair tools | |
| 112 | 110 | * |
| 113 | 111 | * @since 2.6.0 bbPress (r5885) |
| 114 | 112 | */ |
| 115 | 113 | function bbp_register_default_repair_tools() { |
| @@ -515,60 +513,58 @@ | ||
| 515 | 513 | ); |
| 516 | 514 | } |
| 517 | 515 | |
| 518 | 516 | /** |
| 519 | - * Output the tabs in the admin area. | |
| 517 | + * Output the tabs in the admin area | |
| 520 | 518 | * |
| 521 | 519 | * @since 2.1.0 bbPress (r3872) |
| 522 | 520 | * |
| 523 | - * @param string $active_tab Name of the tab that is active. | |
| 521 | + * @param string $active_tab Name of the tab that is active | |
| 524 | 522 | */ |
| 525 | 523 | function bbp_tools_admin_tabs( $active_tab = '' ) { |
| 526 | 524 | echo bbp_get_tools_admin_tabs( $active_tab ); |
| 527 | 525 | } |
| 528 | 526 | |
| 529 | -/** | |
| 530 | - * Output the tabs in the admin area. | |
| 531 | - * | |
| 532 | - * @since 2.1.0 bbPress (r3872) | |
| 533 | - * | |
| 534 | - * @param string $active_tab Name of the tab that is active. | |
| 535 | - * | |
| 536 | - * @return string | |
| 537 | - */ | |
| 538 | -function bbp_get_tools_admin_tabs( $active_tab = '' ) { | |
| 527 | + /** | |
| 528 | + * Output the tabs in the admin area | |
| 529 | + * | |
| 530 | + * @since 2.1.0 bbPress (r3872) | |
| 531 | + * | |
| 532 | + * @param string $active_tab Name of the tab that is active | |
| 533 | + */ | |
| 534 | + function bbp_get_tools_admin_tabs( $active_tab = '' ) { | |
| 539 | 535 | |
| 540 | - // Declare local variables | |
| 541 | - $tabs_html = ''; | |
| 542 | - $idle_class = 'nav-tab'; | |
| 543 | - $active_class = 'nav-tab nav-tab-active'; | |
| 536 | + // Declare local variables | |
| 537 | + $tabs_html = ''; | |
| 538 | + $idle_class = 'nav-tab'; | |
| 539 | + $active_class = 'nav-tab nav-tab-active'; | |
| 544 | 540 | |
| 545 | - // Setup core admin tabs | |
| 546 | - $tabs = bbp_get_tools_admin_pages(); | |
| 541 | + // Setup core admin tabs | |
| 542 | + $tabs = bbp_get_tools_admin_pages(); | |
| 547 | 543 | |
| 548 | - // Loop through tabs and build navigation | |
| 549 | - foreach ( $tabs as $tab ) { | |
| 544 | + // Loop through tabs and build navigation | |
| 545 | + foreach ( $tabs as $tab ) { | |
| 550 | 546 | |
| 551 | - // Skip if user cannot visit page | |
| 552 | - if ( ! current_user_can( $tab['cap'] ) ) { | |
| 553 | - continue; | |
| 547 | + // Skip if user cannot visit page | |
| 548 | + if ( ! current_user_can( $tab['cap'] ) ) { | |
| 549 | + continue; | |
| 550 | + } | |
| 551 | + | |
| 552 | + // Setup tab HTML | |
| 553 | + $is_current = (bool) ( $tab['page'] === $active_tab ); | |
| 554 | + $tab_class = $is_current ? $active_class : $idle_class; | |
| 555 | + $tab_url = add_query_arg( array( 'page' => $tab['page'] ), admin_url( 'tools.php' ) ); | |
| 556 | + | |
| 557 | + // Tab name is not escaped - may contain HTML | |
| 558 | + $tabs_html .= '<a href="' . esc_url( $tab_url ) . '" class="' . esc_attr( $tab_class ) . '">' . $tab['name'] . '</a>'; | |
| 554 | 559 | } |
| 555 | 560 | |
| 556 | - // Setup tab HTML | |
| 557 | - $is_current = (bool) ( $tab['page'] === $active_tab ); | |
| 558 | - $tab_class = $is_current ? $active_class : $idle_class; | |
| 559 | - $tab_url = add_query_arg( array( 'page' => $tab['page'] ), admin_url( 'tools.php' ) ); | |
| 560 | - | |
| 561 | - // Tab name is not escaped - may contain HTML | |
| 562 | - $tabs_html .= '<a href="' . esc_url( $tab_url ) . '" class="' . esc_attr( $tab_class ) . '">' . $tab['name'] . '</a>'; | |
| 561 | + // Output the tabs | |
| 562 | + return $tabs_html; | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | - // Output the tabs | |
| 566 | - return $tabs_html; | |
| 567 | -} | |
| 568 | - | |
| 569 | 565 | /** |
| 570 | - * Return possible tools pages. | |
| 566 | + * Return possible tools pages | |
| 571 | 567 | * |
| 572 | 568 | * @since 2.6.0 bbPress (r6273) |
| 573 | 569 | * |
| 574 | 570 | * @return array |