Make WordPress Core

Ticket #32525: 32525_tab.2.patch

File 32525_tab.2.patch, 5.8 KB (added by Fab1en, 10 years ago)

Dashboard link after the tabs : use h2 to wrap tabs and an existing CSS class for the link

  • src/wp-admin/network/site-info.php

     src/wp-admin/network/site-info.php     | 8 ++++++--
     src/wp-admin/network/site-settings.php | 8 ++++++--
     src/wp-admin/network/site-themes.php   | 8 ++++++--
     src/wp-admin/network/site-users.php    | 8 ++++++--
     4 files changed, 24 insertions(+), 8 deletions(-)
    
    diff --git a/src/wp-admin/network/site-info.php b/src/wp-admin/network/site-info.php
    index 61fea29..2996a9f 100644
    a b $site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $ 
    129129$title_site_url_linked = sprintf( __( 'Edit Site: %s' ), '<a href="' . get_blogaddress_by_id( $id ) . '">' . $site_url_no_http . '</a>' );
    130130$title = sprintf( __( 'Edit Site: %s' ), $site_url_no_http );
    131131
     132$dashboard = '<a class="add-new-h2" href="' . get_admin_url( $id ) . '">' . __( 'Dashboard' ) . '</a>';
     133
    132134$parent_file = 'sites.php';
    133135$submenu_file = 'sites.php';
    134136
    require( ABSPATH . 'wp-admin/admin-header.php' ); 
    138140
    139141<div class="wrap">
    140142<h1 id="edit-site"><?php echo $title_site_url_linked; ?></h1>
    141 <h3 class="nav-tab-wrapper">
     143<h2 class="nav-tab-wrapper">
    142144<?php
    143145$tabs = array(
    144146        'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    foreach ( $tabs as $tab_id => $tab ) { 
    150152        $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    151153        echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    152154}
     155// link to the site dashboard is displayed after the tabs
     156echo $dashboard;
    153157?>
    154 </h3>
     158</h2>
    155159<?php
    156160if ( ! empty( $messages ) ) {
    157161        foreach ( $messages as $msg ) {
  • src/wp-admin/network/site-settings.php

    diff --git a/src/wp-admin/network/site-settings.php b/src/wp-admin/network/site-settings.php
    index 31980ee..5e7d59c 100644
    a b $site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $ 
    7979$title_site_url_linked = sprintf( __( 'Edit Site: %s' ), '<a href="' . get_blogaddress_by_id( $id ) . '">' . $site_url_no_http . '</a>' );
    8080$title = sprintf( __( 'Edit Site: %s' ), $site_url_no_http );
    8181
     82$dashboard = '<a class="add-new-h2" href="' . get_admin_url( $id ) . '">' . __( 'Dashboard' ) . '</a>';
     83
    8284$parent_file = 'sites.php';
    8385$submenu_file = 'sites.php';
    8486
    require( ABSPATH . 'wp-admin/admin-header.php' ); 
    8890
    8991<div class="wrap">
    9092<h1 id="edit-site"><?php echo $title_site_url_linked; ?></h1>
    91 <h3 class="nav-tab-wrapper">
     93<h2 class="nav-tab-wrapper">
    9294<?php
    9395$tabs = array(
    9496        'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    foreach ( $tabs as $tab_id => $tab ) { 
    100102        $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    101103        echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    102104}
     105// link to the site dashboard is displayed after the tabs
     106echo $dashboard;
    103107?>
    104 </h3>
     108</h2>
    105109<?php
    106110if ( ! empty( $messages ) ) {
    107111        foreach ( $messages as $msg )
  • src/wp-admin/network/site-themes.php

    diff --git a/src/wp-admin/network/site-themes.php b/src/wp-admin/network/site-themes.php
    index 0042601..33d7388 100644
    a b $site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $ 
    133133$title_site_url_linked = sprintf( __( 'Edit Site: %s' ), '<a href="' . get_blogaddress_by_id( $id ) . '">' . $site_url_no_http . '</a>' );
    134134$title = sprintf( __( 'Edit Site: %s' ), $site_url_no_http );
    135135
     136$dashboard = '<a class="add-new-h2" href="' . get_admin_url( $id ) . '">' . __( 'Dashboard' ) . '</a>';
     137
    136138$parent_file = 'sites.php';
    137139$submenu_file = 'sites.php';
    138140
    require( ABSPATH . 'wp-admin/admin-header.php' ); ?> 
    140142
    141143<div class="wrap">
    142144<h1 id="edit-site"><?php echo $title_site_url_linked; ?></h1>
    143 <h3 class="nav-tab-wrapper">
     145<h2 class="nav-tab-wrapper">
    144146<?php
    145147$tabs = array(
    146148        'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    foreach ( $tabs as $tab_id => $tab ) { 
    152154        $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    153155        echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    154156}
     157// link to the site dashboard is displayed after the tabs
     158echo $dashboard;
    155159?>
    156 </h3><?php
     160</h2><?php
    157161
    158162if ( isset( $_GET['enabled'] ) ) {
    159163        $enabled = absint( $_GET['enabled'] );
  • src/wp-admin/network/site-users.php

    diff --git a/src/wp-admin/network/site-users.php b/src/wp-admin/network/site-users.php
    index f290565..1e526f2 100644
    a b $site_url_no_http = preg_replace( '#^http(s)?://#', '', get_blogaddress_by_id( $ 
    161161$title_site_url_linked = sprintf( __( 'Edit Site: %s' ), '<a href="' . get_blogaddress_by_id( $id ) . '">' . $site_url_no_http . '</a>' );
    162162$title = sprintf( __( 'Edit Site: %s' ), $site_url_no_http );
    163163
     164$dashboard = '<a class="add-new-h2" href="' . get_admin_url( $id ) . '">' . __( 'Dashboard' ) . '</a>';
     165
    164166$parent_file = 'sites.php';
    165167$submenu_file = 'sites.php';
    166168
    var current_site_id = <?php echo $id; ?>; 
    183185
    184186<div class="wrap">
    185187<h1 id="edit-site"><?php echo $title_site_url_linked; ?></h1>
    186 <h3 class="nav-tab-wrapper">
     188<h2 class="nav-tab-wrapper">
    187189<?php
    188190$tabs = array(
    189191        'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    foreach ( $tabs as $tab_id => $tab ) { 
    195197        $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    196198        echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    197199}
     200// link to the site dashboard is displayed after the tabs
     201echo $dashboard;
    198202?>
    199 </h3><?php
     203</h2><?php
    200204
    201205if ( isset($_GET['update']) ) :
    202206        switch($_GET['update']) {