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 '