WordPress.org

Make WordPress Core

Ticket #15800: 15800.diff

File 15800.diff, 2.6 KB (added by jeremyfelt, 6 years ago)
  • src/wp-admin/includes/ms.php

     
    10301030}
    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
    10361036 *
    1037  * @link https://core.trac.wordpress.org/ticket/15800 discussion
    1038  *
    10391037 * @param $args {
    10401038 *     Optional. Array or string of Query parameters.
    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 */
    10471045function network_edit_site_nav( $args = array() ) {
    10481046
    10491047        /**
    1050          * Filters the links that appear on site-editing network pages
     1048         * Filters the links that appear on site-editing network pages.
    10511049         *
    1052          * Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings'
     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(
    10591067                'site-info'     => array( 'label' => __( 'Info' ),     'url' => 'site-info.php',     'cap' => 'manage_sites' ),
     
    10891097                }
    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
    10951103                $url = add_query_arg( array( 'id' => $r['blog_id'] ), network_admin_url( $link['url'] ) );
     
    10981106                $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '">' . esc_html( $link['label'] ) . '</a>';
    10991107        }
    11001108
    1101         // Start a buffer
    1102         ob_start();
    1103 
    11041109        // All done!
    11051110        echo '<h2 class="nav-tab-wrapper wp-clearfix">';
    11061111        echo implode( '', $screen_links );
    11071112        echo '</h2>';
    1108 
    1109         // Output the nav
    1110         echo ob_get_clean();
    11111113}