$current_site = get_current_site();
- $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
+ if ( ! empty( $_REQUEST['mode'] ) ) {
+ $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
+ set_user_setting( 'sites_list_mode', $mode );
+ } else {
+ $mode = get_user_setting( 'sites_list_mode', 'list' );
+ }
$per_page = $this->get_items_per_page( 'sites_network_per_page' );
/*
* If the network is large and a search is not being performed, show only
- * the latest blogs with no paging in order to avoid expensive count queries.
+ * the latest sites with no paging in order to avoid expensive count queries.
*/
if ( !$s && wp_is_large_network() ) {
if ( !isset($_REQUEST['orderby']) )
}
/**
- * Handles the blogname column output.
+ * Handles the site name column output.
*
* @since 4.3.0
* @access public
*
* @global string $mode
*
- * @param array $blog Current blog.
+ * @param array $blog Current site.
*/
public function column_blogname( $blog ) {
global $mode;
<?php
if ( 'list' !== $mode ) {
switch_to_blog( $blog['blog_id'] );
- /* translators: 1: site name, 2: site tagline. */
- echo '<p>' . sprintf( __( '%1$s – <em>%2$s</em>' ), get_option( 'blogname' ), get_option( 'blogdescription ' ) ) . '</p>';
+ echo '<p>';
+ printf(
+ /* translators: 1: site name, 2: site tagline. */
+ __( '%1$s – %2$s' ),
+ get_option( 'blogname' ),
+ '<em>' . get_option( 'blogdescription ' ) . '</em>'
+ );
+ echo '</p>';
restore_current_blog();
}
}
* @since 4.3.0
* @access protected
*
- * @param object $blog Blog being acted upon.
+ * @param object $blog Site being acted upon.
* @param string $column_name Current column name.
* @param string $primary Primary column name.
* @return string Row actions output.