}
function prepare_items() {
- global $s, $mode, $wpdb, $current_site;
+ global $s, $mode, $wpdb;
+
+ $current_site = get_current_site();
$mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
if ( has_filter( 'wpmublogsaction' ) )
$sites_columns['plugins'] = __( 'Actions' );
+ /**
+ * Filter the displayed site columns in Sites list table.
+ *
+ * @since MU
+ *
+ * @param array $sites_columns An array of displayed site columns. Default 'cb',
+ * 'blogname', 'lastupdated', 'registered', 'users'.
+ */
$sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
return $sites_columns;
}
function display_rows() {
- global $current_site, $mode;
+ global $mode;
$status_list = array(
'archived' => array( 'site-archived', __( 'Archived' ) ),
}
echo "<tr class='$class'>";
- $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
+ $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) : $blog['path'];
list( $columns, $hidden ) = $this->get_column_info();
switch ( $column_name ) {
case 'cb': ?>
<th scope="row" class="check-column">
+ <?php if ( ! is_main_site( $blog['blog_id'] ) ) : ?>
<label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>"><?php printf( __( 'Select %s' ), $blogname ); ?></label>
<input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ) ?>" />
+ <?php endif; ?>
</th>
<?php
break;
$actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
$actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
- if ( $current_site->blog_id != $blog['blog_id'] ) {
+ if ( get_current_site()->blog_id != $blog['blog_id'] ) {
if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
$actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';
else
$actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
+ /**
+ * Filter the action links displayed for each site in the Sites list table.
+ *
+ * The 'Edit', 'Dashboard', 'Delete', and 'Visit' links are displayed by
+ * default for each site. The site's status determines whether to show the
+ * 'Activate' or 'Deactivate' link, 'Unarchive' or 'Archive' links, and
+ * 'Not Spam' or 'Spam' link for each site.
+ *
+ * @since 3.1.0
+ *
+ * @param array $actions An array of action links to be displayed.
+ * @param int $blog_id The site ID.
+ * @param string $blogname Site path, formatted depending on whether it is a sub-domain
+ * or subdirectory multisite install.
+ */
$actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
echo $this->row_actions( $actions );
?>
case 'plugins': ?>
<?php if ( has_filter( 'wpmublogsaction' ) ) {
echo "<td valign='top' class='$column_name column-$column_name'$style>";
+ /**
+ * Fires inside the auxiliary 'Actions' column of the Sites list table.
+ *
+ * By default this column is hidden unless something is hooked to the action.
+ *
+ * @since MU
+ *
+ * @param int $blog_id The site ID.
+ */
do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
</td>
<?php }
default:
echo "<td class='$column_name column-$column_name'$style>";
+ /**
+ * Fires for each registered custom column in the Sites list table.
+ *
+ * @since 3.1.0
+ *
+ * @param string $column_name The name of the column to display.
+ * @param int $blog_id The site ID.
+ */
do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
echo "</td>";
break;