: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Prints JavaScript in the header on the Network Settings screen.
function network_settings_add_js() {
<script type="text/javascript">
var languageSelect = $( '#WPLANG' );
$( 'form' ).on( 'submit', function() {
* Don't show a spinner for English and installed languages,
* as there is nothing to download.
if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
$( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
* Outputs the HTML for a network's "Edit Site" tabular interface.
* @global string $pagenow The filename of the current screen.
* Optional. Array or string of Query parameters. Default empty array.
* @type int $blog_id The site ID. Default is the current site.
* @type array $links The tabs to include with (label|url|cap) keys.
* @type string $selected The ID of the selected link.
function network_edit_site_nav( $args = array() ) {
* Filters the links that appear on site-editing network pages.
* Default links: 'site-info', 'site-users', 'site-themes', and 'site-settings'.
* An array of link data representing individual network admin pages.
* @type array $link_slug {
* An array of information about the individual link to a page.
* $type string $label Label to use for the link.
* $type string $url URL, relative to `network_admin_url()` to use for the link.
* $type string $cap Capability required to see the link.
'network_edit_site_nav_links',
'url' => 'site-info.php',
'label' => __( 'Users' ),
'url' => 'site-users.php',
'label' => __( 'Themes' ),
'url' => 'site-themes.php',
'site-settings' => array(
'label' => __( 'Settings' ),
'url' => 'site-settings.php',
$parsed_args = wp_parse_args(
'blog_id' => isset( $_GET['blog_id'] ) ? (int) $_GET['blog_id'] : 0,
'selected' => 'site-info',
// Setup the links array.
foreach ( $parsed_args['links'] as $link_id => $link ) {
// Skip link if user can't access.
if ( ! current_user_can( $link['cap'], $parsed_args['blog_id'] ) ) {
$classes = array( 'nav-tab' );
// Aria-current attribute.
// Selected is set by the parent OR assumed by the $pagenow global.
if ( $parsed_args['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
$classes[] = 'nav-tab-active';
$aria_current = ' aria-current="page"';
$esc_classes = implode( ' ', $classes );
// Get the URL for this link.
$url = add_query_arg( array( 'id' => $parsed_args['blog_id'] ), network_admin_url( $link['url'] ) );
// Add link to nav links.
$screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>';
echo '<nav class="nav-tab-wrapper wp-clearfix" aria-label="' . esc_attr__( 'Secondary menu' ) . '">';
echo implode( '', $screen_links );
* Returns the arguments for the help tab on the Edit Site screens.
* @return array Help tab arguments.
function get_site_screen_help_tab_args() {
'title' => __( 'Overview' ),
'<p>' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '</p>' .
'<p>' . __( '<strong>Info</strong> — The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .
'<p>' . __( '<strong>Users</strong> — This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .
/* translators: %s: URL to Network Themes screen. */
__( '<strong>Themes</strong> — This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ),
network_admin_url( 'themes.php' )
'<p>' . __( '<strong>Settings</strong> — This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>',
* Returns the content for the help sidebar on the Edit Site screens.
* @return string Help sidebar content.
function get_site_screen_help_sidebar_content() {
return '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>';