Changeset 7381 for trunk/src/includes/admin/tools.php
- Timestamp:
- 12/05/2025 03:03:50 AM (4 months ago)
- File:
-
- 1 edited
-
trunk/src/includes/admin/tools.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/tools.php
r7380 r7381 525 525 } 526 526 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 = '' ) { 535 536 // Declare local variables 537 $tabs_html = ''; 538 $idle_class = 'nav-tab'; 539 $active_class = 'nav-tab nav-tab-active'; 540 541 // Setup core admin tabs 542 $tabs = bbp_get_tools_admin_pages(); 543 544 // Loop through tabs and build navigation 545 foreach ( $tabs as $tab ) { 546 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>'; 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 = '' ) { 535 536 // Declare local variables 537 $tabs_html = ''; 538 $idle_class = 'nav-tab'; 539 $active_class = 'nav-tab nav-tab-active'; 540 541 // Setup core admin tabs 542 $tabs = bbp_get_tools_admin_pages(); 543 544 // Loop through tabs and build navigation 545 foreach ( $tabs as $tab ) { 546 547 // Skip if user cannot visit page 548 if ( ! current_user_can( $tab['cap'] ) ) { 549 continue; 559 550 } 560 551 561 // Output the tabs 562 return $tabs_html; 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>'; 563 559 } 560 561 // Output the tabs 562 return $tabs_html; 563 } 564 564 565 565 /**
Note: See TracChangeset
for help on using the changeset viewer.