Make WordPress Core

Ticket #15800: 15800.patch

File 15800.patch, 6.1 KB (added by c3mdigital, 11 years ago)
  • wp-admin/includes/ms.php

     
    797797}
    798798
    799799/**
     800 * Output the html for the network Edit Site page tabs
     801 *
     802 * @since 3.9.0
     803 *
     804 * @uses apply_filters() Calls 'network_edit_site_tabs' on 'info', 'users', 'themes', and settings tabs.
     805 * @uses apply_filters() Calls 'network_edit_site_tab_html' on 'tab_html
     806 *
     807 * @param int $id The blog_id of the current site being edited.
     808 */
     809function network_edit_site_tabs( $id ) {
     810        global $pagenow;
     811        $tabs = array(
     812          'site-info'     => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
     813          'site-users'    => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
     814          'site-themes'   => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
     815          'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
     816        );
     817        $tabs = apply_filters( 'network_edit_site_tabs', $tabs, $id, $pagenow );
     818
     819        foreach ( $tabs as $tab_id => $tab ) {
     820                if ( isset( $tab['menu-slug'] ) && isset( $tab['callback-function'] ) ) {
     821                        $menu_slug = plugin_basename( $tab['menu-slug'] );
     822                        $html = sprintf(
     823                          '<a href="%s" class="nav-tab %s">%s</a>',
     824                          add_query_arg( array( 'id' => $id ), network_admin_url( 'admin.php?page=' . $tab['menu-slug'] ) ),
     825                          isset( $_GET['page'] ) && $menu_slug == $_GET['page'] ? ' nav-tab-active' : '',
     826                          esc_html( $tab['label'] )
     827                        );
     828                        echo $html;
     829                        $admin_page_hooks[$menu_slug] = sanitize_title( $tab['label'] );
     830                }
     831                else {
     832                        $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
     833                        $tab_html = '<a href="' . $tab['url'] . '?id=' . $id . '" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
     834                        echo apply_filters( 'network_edit_site_tab_html', $tab_html, $tab, $class, $id );
     835                }
     836        }
     837}
     838
     839/**
    800840 * Thickbox image paths for Network Admin.
    801841 *
    802842 * @since 3.1.0
  • wp-admin/network/site-info.php

     
    9898<div class="wrap">
    9999<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
    100100<h3 class="nav-tab-wrapper">
    101 <?php
    102 $tabs = array(
    103         'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    104         'site-users'    => array( 'label' => __( 'Users' ),    'url' => 'site-users.php'    ),
    105         'site-themes'   => array( 'label' => __( 'Themes' ),   'url' => 'site-themes.php'   ),
    106         'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
    107 );
    108 foreach ( $tabs as $tab_id => $tab ) {
    109         $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    110         echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    111 }
    112 ?>
     101<?php network_edit_site_tabs( $id ) ?>
    113102</h3>
    114103<?php
    115104if ( ! empty( $messages ) ) {
  • wp-admin/network/site-settings.php

     
    8989<div class="wrap">
    9090<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
    9191<h3 class="nav-tab-wrapper">
    92 <?php
    93 $tabs = array(
    94         'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    95         'site-users'    => array( 'label' => __( 'Users' ),    'url' => 'site-users.php'    ),
    96         'site-themes'   => array( 'label' => __( 'Themes' ),   'url' => 'site-themes.php'   ),
    97         'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
    98 );
    99 foreach ( $tabs as $tab_id => $tab ) {
    100         $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    101         echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    102 }
    103 ?>
     92<?php network_edit_site_tabs( $id ) ?>
    10493</h3>
    10594<?php
    10695if ( ! empty( $messages ) ) {
  • wp-admin/network/site-themes.php

     
    137137<div class="wrap">
    138138<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
    139139<h3 class="nav-tab-wrapper">
    140 <?php
    141 $tabs = array(
    142         'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    143         'site-users'    => array( 'label' => __( 'Users' ),    'url' => 'site-users.php'    ),
    144         'site-themes'   => array( 'label' => __( 'Themes' ),   'url' => 'site-themes.php'   ),
    145         'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
    146 );
    147 foreach ( $tabs as $tab_id => $tab ) {
    148         $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    149         echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    150 }
    151 ?>
     140<?php network_edit_site_tabs( $id ) ?>
    152141</h3><?php
    153142
    154143if ( isset( $_GET['enabled'] ) ) {
  • wp-admin/network/site-users.php

     
    186186<div class="wrap">
    187187<h2 id="edit-site"><?php echo $title_site_url_linked ?></h2>
    188188<h3 class="nav-tab-wrapper">
    189 <?php
    190 $tabs = array(
    191         'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php'     ),
    192         'site-users'    => array( 'label' => __( 'Users' ),    'url' => 'site-users.php'    ),
    193         'site-themes'   => array( 'label' => __( 'Themes' ),   'url' => 'site-themes.php'   ),
    194         'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
    195 );
    196 foreach ( $tabs as $tab_id => $tab ) {
    197         $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
    198         echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
    199 }
    200 ?>
     189<?php network_edit_site_tabs( $id ) ?>
    201190</h3><?php
    202191
    203192if ( isset($_GET['update']) ) :