]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-ms-sites-list-table.php
WordPress 4.4
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-ms-sites-list-table.php
index 9fe3f482d40bd72007592a29a90a26837082a1cc..cf3acf9225c28a19838eec50154a9a94790a7c4a 100644 (file)
@@ -1,11 +1,19 @@
 <?php
 /**
 <?php
 /**
- * Sites List Table class.
+ * List Table API: WP_MS_Sites_List_Table class
  *
  * @package WordPress
  *
  * @package WordPress
- * @subpackage List_Table
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying sites in a list table for the network admin.
+ *
  * @since 3.1.0
  * @access private
  * @since 3.1.0
  * @access private
+ *
+ * @see WP_List_Table
  */
 class WP_MS_Sites_List_Table extends WP_List_Table {
 
  */
 class WP_MS_Sites_List_Table extends WP_List_Table {
 
@@ -122,24 +130,24 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                }
 
                $order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
                }
 
                $order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
-               if ( $order_by == 'registered' ) {
+               if ( $order_by === 'registered' ) {
                        $query .= ' ORDER BY registered ';
                        $query .= ' ORDER BY registered ';
-               } elseif ( $order_by == 'lastupdated' ) {
+               } elseif ( $order_by === 'lastupdated' ) {
                        $query .= ' ORDER BY last_updated ';
                        $query .= ' ORDER BY last_updated ';
-               } elseif ( $order_by == 'blogname' ) {
+               } elseif ( $order_by === 'blogname' ) {
                        if ( is_subdomain_install() ) {
                                $query .= ' ORDER BY domain ';
                        } else {
                                $query .= ' ORDER BY path ';
                        }
                        if ( is_subdomain_install() ) {
                                $query .= ' ORDER BY domain ';
                        } else {
                                $query .= ' ORDER BY path ';
                        }
-               } elseif ( $order_by == 'blog_id' ) {
+               } elseif ( $order_by === 'blog_id' ) {
                        $query .= ' ORDER BY blog_id ';
                } else {
                        $order_by = null;
                }
 
                if ( isset( $order_by ) ) {
                        $query .= ' ORDER BY blog_id ';
                } else {
                        $order_by = null;
                }
 
                if ( isset( $order_by ) ) {
-                       $order = ( isset( $_REQUEST['order'] ) && 'DESC' == strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
+                       $order = ( isset( $_REQUEST['order'] ) && 'DESC' === strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
                        $query .= $order;
                }
 
                        $query .= $order;
                }
 
@@ -190,7 +198,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
 
                parent::pagination( $which );
 
 
                parent::pagination( $which );
 
-               if ( 'top' == $which )
+               if ( 'top' === $which )
                        $this->view_switcher( $mode );
        }
 
                        $this->view_switcher( $mode );
        }
 
@@ -251,6 +259,18 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                <?php endif;
        }
 
                <?php endif;
        }
 
+       /**
+        * Handles the ID column output.
+        *
+        * @since 4.4.0
+        * @access public
+        *
+        * @param array $blog Current site.
+        */
+       public function column_id( $blog ) {
+               echo $blog['blog_id'];
+       }
+
        /**
         * Handles the blogname column output.
         *
        /**
         * Handles the blogname column output.
         *
@@ -307,13 +327,13 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
        public function column_lastupdated( $blog ) {
                global $mode;
 
        public function column_lastupdated( $blog ) {
                global $mode;
 
-               if ( 'list' == $mode ) {
+               if ( 'list' === $mode ) {
                        $date = __( 'Y/m/d' );
                } else {
                        $date = __( 'Y/m/d g:i:s a' );
                }
 
                        $date = __( 'Y/m/d' );
                } else {
                        $date = __( 'Y/m/d g:i:s a' );
                }
 
-               echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );
+               echo ( $blog['last_updated'] === '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );
        }
 
        /**
        }
 
        /**
@@ -327,13 +347,13 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
        public function column_registered( $blog ) {
                global $mode;
 
        public function column_registered( $blog ) {
                global $mode;
 
-               if ( 'list' == $mode ) {
+               if ( 'list' === $mode ) {
                        $date = __( 'Y/m/d' );
                } else {
                        $date = __( 'Y/m/d g:i:s a' );
                }
 
                        $date = __( 'Y/m/d' );
                } else {
                        $date = __( 'Y/m/d g:i:s a' );
                }
 
-               if ( $blog['registered'] == '0000-00-00 00:00:00' ) {
+               if ( $blog['registered'] === '0000-00-00 00:00:00' ) {
                        echo '&#x2014;';
                } else {
                        echo mysql2date( $date, $blog['registered'] );
                        echo '&#x2014;';
                } else {
                        echo mysql2date( $date, $blog['registered'] );
@@ -471,33 +491,33 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
                        'visit' => '',
                );
 
                        'visit' => '',
                );
 
-               $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>';
+               $actions['edit']        = '<a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a>';
+               $actions['backend']     = "<a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a>';
                if ( get_current_site()->blog_id != $blog['blog_id'] ) {
                        if ( $blog['deleted'] == '1' ) {
                if ( get_current_site()->blog_id != $blog['blog_id'] ) {
                        if ( $blog['deleted'] == '1' ) {
-                               $actions['activate']   = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a></span>';
+                               $actions['activate']   = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=activateblog&amp;id=' . $blog['blog_id'] ), 'activateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Activate' ) . '</a>';
                        } else {
                        } else {
-                               $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a></span>';
+                               $actions['deactivate'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deactivateblog&amp;id=' . $blog['blog_id'] ), 'deactivateblog_' . $blog['blog_id'] ) ) . '">' . __( 'Deactivate' ) . '</a>';
                        }
 
                        if ( $blog['archived'] == '1' ) {
                        }
 
                        if ( $blog['archived'] == '1' ) {
-                               $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a></span>';
+                               $actions['unarchive'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] ), 'unarchiveblog_' . $blog['blog_id'] ) ) . '">' . __( 'Unarchive' ) . '</a>';
                        } else {
                        } else {
-                               $actions['archive']   = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
+                               $actions['archive']   = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] ), 'archiveblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a>';
                        }
 
                        if ( $blog['spam'] == '1' ) {
                        }
 
                        if ( $blog['spam'] == '1' ) {
-                               $actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
+                               $actions['unspam'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] ), 'unspamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a>';
                        } else {
                        } else {
-                               $actions['spam']   = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
+                               $actions['spam']   = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] ), 'spamblog_' . $blog['blog_id'] ) ) . '">' . _x( 'Spam', 'site' ) . '</a>';
                        }
 
                        if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) {
                        }
 
                        if ( current_user_can( 'delete_site', $blog['blog_id'] ) ) {
-                               $actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] ), 'deleteblog_' . $blog['blog_id'] ) ) . '">' . __( 'Delete' ) . '</a></span>';
+                               $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] ), 'deleteblog_' . $blog['blog_id'] ) ) . '">' . __( 'Delete' ) . '</a>';
                        }
                }
 
                        }
                }
 
-               $actions['visit']       = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
+               $actions['visit']       = "<a href='" . esc_url( get_home_url( $blog['blog_id'], '/' ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a>';
 
                /**
                 * Filter the action links displayed for each site in the Sites list table.
 
                /**
                 * Filter the action links displayed for each site in the Sites list table.