Changeset 12897
- Timestamp:
- 04/20/2021 04:02:22 PM (4 years ago)
- Location:
- trunk/src/bp-core/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-functions.php
r12886 r12897 390 390 * 391 391 * @since 1.5.0 392 * @since 8.0.0 Adds the `$context` parameter. 392 393 * 393 394 * @param string $active_tab Name of the tab that is active. Optional. 394 */ 395 function bp_core_admin_tabs( $active_tab = '' ) { 395 * @param string $context The context of use for the tabs. Defaults to 'settings'. 396 * Possible values are 'settings' & 'tools'. 397 */ 398 function bp_core_admin_tabs( $active_tab = '', $context = 'settings' ) { 396 399 $tabs_html = ''; 397 400 $idle_class = 'nav-tab'; … … 405 408 * @param array $value Array of tabs to output to the admin area. 406 409 */ 407 $tabs = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab ) );410 $tabs = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab, $context ) ); 408 411 409 412 // Loop through tabs and build navigation. … … 420 423 * 421 424 * @since 1.5.0 425 * @since 8.0.0 Adds the `$context` parameter. 426 * 427 * @param string $context The context of use for the tabs. 422 428 */ 423 do_action( 'bp_admin_tabs' );429 do_action( 'bp_admin_tabs', $context ); 424 430 } 425 431 … … 428 434 * 429 435 * @since 2.2.0 436 * @since 8.0.0 Adds the `$context` parameter. 430 437 * 431 438 * @param string $active_tab Name of the tab that is active. Optional. 439 * @param string $context The context of use for the tabs. Defaults to 'settings'. 440 * Possible values are 'settings' & 'tools'. 432 441 * @return string 433 442 */ 434 function bp_core_get_admin_tabs( $active_tab = '' ) { 435 $tabs = array( 436 '0' => array( 437 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ), 438 'name' => __( 'Components', 'buddypress' ), 439 ), 440 '2' => array( 441 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ), 442 'name' => __( 'Options', 'buddypress' ), 443 ), 444 '1' => array( 445 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ), 446 'name' => __( 'Pages', 'buddypress' ), 447 ), 448 '3' => array( 449 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ), 450 'name' => __( 'Credits', 'buddypress' ), 451 ), 452 ); 443 function bp_core_get_admin_tabs( $active_tab = '', $context = 'settings' ) { 444 $tabs = array(); 445 446 if ( 'settings' === $context ) { 447 $tabs = array( 448 '0' => array( 449 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ), 450 'name' => __( 'Components', 'buddypress' ), 451 ), 452 '2' => array( 453 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ), 454 'name' => __( 'Options', 'buddypress' ), 455 ), 456 '1' => array( 457 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ), 458 'name' => __( 'Pages', 'buddypress' ), 459 ), 460 '3' => array( 461 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ), 462 'name' => __( 'Credits', 'buddypress' ), 463 ), 464 ); 465 } elseif ( 'tools' === $context ) { 466 $tools_page = 'tools.php'; 467 if ( bp_core_do_network_admin() ) { 468 $tools_page = 'admin.php'; 469 } 470 471 $tabs = array( 472 '0' => array( 473 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), $tools_page ) ), 474 'name' => __( 'Repair', 'buddypress' ), 475 ), 476 ); 477 } 453 478 454 479 /** … … 456 481 * 457 482 * @since 2.2.0 483 * @since 8.0.0 Adds the `$context` parameter. 458 484 * 459 * @param array $tabs Tab data. 485 * @param array $tabs Tab data. 486 * @param string $context The context of use for the tabs. 460 487 */ 461 return apply_filters( 'bp_core_get_admin_tabs', $tabs );488 return apply_filters( 'bp_core_get_admin_tabs', $tabs, $context ); 462 489 } 463 490 -
trunk/src/bp-core/admin/bp-core-admin-tools.php
r12826 r12897 22 22 <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1> 23 23 <hr class="wp-header-end"> 24 25 <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Repair', 'buddypress' ), 'tools' ); ?></h2> 24 26 25 27 <p><?php esc_html_e( 'BuddyPress keeps track of various relationships between members, groups, and activity items.', 'buddypress' ); ?></p> … … 542 544 $url = add_query_arg( $query_arg, bp_get_admin_url( $page ) ); 543 545 ?> 544 <div class="card tool-box ">546 <div class="card tool-box bp-tools"> 545 547 <h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2> 546 <p> 547 <?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?> 548 <?php 549 printf( 550 /* translators: %s: the link to the BuddyPress repair tools */ 551 esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ), 552 '<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Tools', 'buddypress' ) . '</a>' 553 ); 554 ?> 555 </p> 548 549 <dl> 550 <dt><?php esc_html_e( 'Repair Tools', 'buddypress' ) ?></dt> 551 <dd> 552 <?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?> 553 <?php 554 printf( 555 /* translators: %s: the link to the BuddyPress repair tools */ 556 esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ), 557 '<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Repair Tools', 'buddypress' ) . '</a>' 558 ); 559 ?> 560 </dd> 561 </dl> 556 562 </div> 557 563 <?php -
trunk/src/bp-core/admin/css/common.css
r12739 r12897 305 305 #adminmenu .toplevel_page_network-tools div.wp-menu-image:before { 306 306 content: ""; 307 } 308 309 body.tools-php .bp-tools dt { 310 font-size: 1.1em; 311 color: #646970; 312 font-weight: 600; 313 margin: 1em 0 0.5em 0; 314 } 315 316 body.tools-php .bp-tools dd { 317 margin: 0; 307 318 } 308 319
Note: See TracChangeset
for help on using the changeset viewer.