Ticket #15800: 15800.diff
File 15800.diff, 2.6 KB (added by , 9 years ago) |
---|
-
src/wp-admin/includes/ms.php
1030 1030 } 1031 1031 1032 1032 /** 1033 * Outputs the HTML for a network's "Edit Site" tabular interface 1033 * Outputs the HTML for a network's "Edit Site" tabular interface. 1034 1034 * 1035 1035 * @since 4.6.0 1036 1036 * 1037 * @link https://core.trac.wordpress.org/ticket/15800 discussion1038 *1039 1037 * @param $args { 1040 1038 * Optional. Array or string of Query parameters. 1041 1039 * 1042 1040 * @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. 1045 1043 * } 1046 1044 */ 1047 1045 function network_edit_site_nav( $args = array() ) { 1048 1046 1049 1047 /** 1050 * Filters the links that appear on site-editing network pages 1048 * Filters the links that appear on site-editing network pages. 1051 1049 * 1052 * Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings' 1050 * Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings'. 1053 1051 * 1054 1052 * @since 4.6.0 1055 1053 * 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 * } 1057 1065 */ 1058 1066 $links = apply_filters( 'network_edit_site_nav_links', array( 1059 1067 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php', 'cap' => 'manage_sites' ), … … 1089 1097 } 1090 1098 1091 1099 // Escape each class 1092 $esc_classes = implode( ' ', array_map( 'esc_attr', $classes ));1100 $esc_classes = implode( ' ', $classes ); 1093 1101 1094 1102 // Get the URL for this link 1095 1103 $url = add_query_arg( array( 'id' => $r['blog_id'] ), network_admin_url( $link['url'] ) ); … … 1098 1106 $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '">' . esc_html( $link['label'] ) . '</a>'; 1099 1107 } 1100 1108 1101 // Start a buffer1102 ob_start();1103 1104 1109 // All done! 1105 1110 echo '<h2 class="nav-tab-wrapper wp-clearfix">'; 1106 1111 echo implode( '', $screen_links ); 1107 1112 echo '</h2>'; 1108 1109 // Output the nav1110 echo ob_get_clean();1111 1113 }