Make WordPress Core

Changeset 37629


Ignore:
Timestamp:
06/02/2016 10:28:17 PM (10 years ago)
Author:
jeremyfelt
Message:

Multisite: Remove superfluous code from network_edit_site_nav()

  • Remove output buffering.
  • Remove esc_attr() when outputting hard coded class names.
  • Update documentation.

Fixes #15800.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms.php

    r37488 r37629  
    10311031
    10321032/**
    1033  * Outputs the HTML for a network's "Edit Site" tabular interface
     1033 * Outputs the HTML for a network's "Edit Site" tabular interface.
    10341034 *
    10351035 * @since 4.6.0
    1036  *
    1037  * @link https://core.trac.wordpress.org/ticket/15800 discussion
    10381036 *
    10391037 * @param $args {
    … …  
    10411039 *
    10421040 *     @type int     $blog_id   The site ID. Default is the current site.
    1043  *     @type array   $links     The tabs to include with (label|url|cap) keys
    1044  *     @type string  $selected  The ID of the selected link
     1041 *     @type array   $links     The tabs to include with (label|url|cap) keys.
     1042 *     @type string  $selected  The ID of the selected link.
    10451043 * }
    10461044 */
    … …  
    10481046
    10491047        /**
    1050          * Filters the links that appear on site-editing network pages
    1051          *
    1052          * Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings'
     1048         * Filters the links that appear on site-editing network pages.
     1049         *
     1050         * Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings'.
    10531051         *
    10541052         * @since 4.6.0
    10551053         *
    1056          * @param array Array of link data.
     1054         * @param array $links {
     1055         *     An array of link data representing individual network admin pages.
     1056         *
     1057         *     @type array $link_slug {
     1058         *         An array of information about the individual link to a page.
     1059         *
     1060         *         $type string $label Label to use for the link.
     1061         *         $type string $url   URL, relative to `network_admin_url()` to use for the link.
     1062         *         $type string $cap   Capability required to see the link.
     1063         *     }
     1064         * }
    10571065         */
    10581066        $links = apply_filters( 'network_edit_site_nav_links', array(
    … …  
    10901098
    10911099                // Escape each class
    1092                 $esc_classes = implode( ' ', array_map( 'esc_attr', $classes ) );
     1100                $esc_classes = implode( ' ', $classes );
    10931101
    10941102                // Get the URL for this link
    … …  
    10981106                $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '">' . esc_html( $link['label'] ) . '</a>';
    10991107        }
    1100 
    1101         // Start a buffer
    1102         ob_start();
    11031108
    11041109        // All done!
    … …  
    11061111        echo implode( '', $screen_links );
    11071112        echo '</h2>';
    1108 
    1109         // Output the nav
    1110         echo ob_get_clean();
    1111 }
     1113}
Note: See TracChangeset for help on using the changeset viewer.