blogname ) ), 'updated' ); } else { add_settings_error( 'wpseo_ms', 'settings_updated', sprintf( __( 'Blog %s not found.', 'wordpress-seo' ), esc_html( $restoreblog ) ), 'error' ); } unset( $restoreblog, $blog ); } } /* Set up selectbox dropdowns for smaller networks (usability) */ $use_dropdown = true; if ( get_blog_count() > 100 ) { $use_dropdown = false; } else { if ( function_exists( 'get_sites' ) ) { // WP 4.6+. $sites = array_map( 'get_object_vars', get_sites( array( 'deleted' => 0 ) ) ); } else { $sites = wp_get_sites( array( 'deleted' => 0 ) ); } if ( is_array( $sites ) && $sites !== array() ) { $dropdown_input = array( '-' => __( 'None', 'wordpress-seo' ), ); foreach ( $sites as $site ) { $dropdown_input[ $site['blog_id'] ] = $site['blog_id'] . ': ' . $site['domain']; $blog_states = array(); if ( $site['public'] === '1' ) { $blog_states[] = __( 'public', 'wordpress-seo' ); } if ( $site['archived'] === '1' ) { $blog_states[] = __( 'archived', 'wordpress-seo' ); } if ( $site['mature'] === '1' ) { $blog_states[] = __( 'mature', 'wordpress-seo' ); } if ( $site['spam'] === '1' ) { $blog_states[] = __( 'spam', 'wordpress-seo' ); } if ( $blog_states !== array() ) { $dropdown_input[ $site['blog_id'] ] .= ' [' . implode( ', ', $blog_states ) . ']'; } } unset( $site, $blog_states ); } else { $use_dropdown = false; } unset( $sites ); } $yform->admin_header( false, 'wpseo_ms' ); echo '

', __( 'MultiSite Settings', 'wordpress-seo' ), '

'; echo '
'; wp_nonce_field( 'wpseo-network-settings', '_wpnonce', true, true ); /* @internal Important: Make sure the options added to the array here are in line with the options set in the WPSEO_Option_MS::$allowed_access_options property */ $yform->select( 'access', /* translators: %1$s expands to Yoast SEO */ sprintf( __( 'Who should have access to the %1$s settings', 'wordpress-seo' ), 'Yoast SEO' ), array( 'admin' => __( 'Site Admins (default)', 'wordpress-seo' ), 'superadmin' => __( 'Super Admins only', 'wordpress-seo' ), ), 'wpseo_ms' ); if ( $use_dropdown === true ) { $yform->select( 'defaultblog', __( 'New sites in the network inherit their SEO settings from this site', 'wordpress-seo' ), $dropdown_input, 'wpseo_ms' ); echo '

' . __( 'Choose the site whose settings you want to use as default for all sites that are added to your network. If you choose \'None\', the normal plugin defaults will be used.', 'wordpress-seo' ) . '

'; } else { $yform->textinput( 'defaultblog', __( 'New sites in the network inherit their SEO settings from this site', 'wordpress-seo' ), 'wpseo_ms' ); /* translators: 1: link open tag; 2: link close tag. */ echo '

' . sprintf( __( 'Enter the %1$sSite ID%2$s for the site whose settings you want to use as default for all sites that are added to your network. Leave empty for none (i.e. the normal plugin defaults will be used).', 'wordpress-seo' ), '', '' ) . '

'; } echo '

' . __( 'Take note:', 'wordpress-seo' ) . ' ' . __( 'Privacy sensitive (FB admins and such), theme specific (title rewrite) and a few very site specific settings will not be imported to new blogs.', 'wordpress-seo' ) . '

'; echo ''; echo '
'; echo '

' . __( 'Restore site to default settings', 'wordpress-seo' ) . '

'; echo '
'; wp_nonce_field( 'wpseo-network-restore', '_wpnonce', true, true ); echo '

' . __( 'Using this form you can reset a site to the default SEO settings.', 'wordpress-seo' ) . '

'; if ( $use_dropdown === true ) { unset( $dropdown_input['-'] ); $yform->select( 'restoreblog', __( 'Site ID', 'wordpress-seo' ), $dropdown_input, 'wpseo_ms' ); } else { $yform->textinput( 'restoreblog', __( 'Blog ID', 'wordpress-seo' ), 'wpseo_ms' ); } echo ''; echo '
'; $yform->admin_footer( false );