]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/class-wp-ms-themes-list-table.php
WordPress 4.4
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-ms-themes-list-table.php
index 991a07749a4c7151cf61fc502eae643d89f59539..ef1ab91b3d5362f9523b6375fe7536c9ba7cafcf 100644 (file)
@@ -1,11 +1,19 @@
 <?php
 /**
- * MS Themes List Table class.
+ * List Table API: WP_MS_Themes_List_Table class
  *
  * @package WordPress
- * @subpackage List_Table
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Core class used to implement displaying themes in a list table for the network admin.
+ *
  * @since 3.1.0
  * @access private
+ *
+ * @see WP_List_Table
  */
 class WP_MS_Themes_List_Table extends WP_List_Table {
 
@@ -41,7 +49,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
 
                $page = $this->get_pagenum();
 
-               $this->is_site_themes = ( 'site-themes-network' == $this->screen->id ) ? true : false;
+               $this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;
 
                if ( $this->is_site_themes )
                        $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
@@ -145,9 +153,10 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
                        $orderby = ucfirst( $orderby );
                        $order = strtoupper( $order );
 
-                       if ( $orderby == 'Name' ) {
-                               if ( 'ASC' == $order )
+                       if ( $orderby === 'Name' ) {
+                               if ( 'ASC' === $order ) {
                                        $this->items = array_reverse( $this->items );
+                               }
                        } else {
                                uasort( $this->items, array( $this, '_order_callback' ) );
                        }
@@ -206,7 +215,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
                if ( $a == $b )
                        return 0;
 
-               if ( 'DESC' == $order )
+               if ( 'DESC' === $order )
                        return ( $a < $b ) ? 1 : -1;
                else
                        return ( $a < $b ) ? -1 : 1;
@@ -216,10 +225,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
         * @access public
         */
        public function no_items() {
-               if ( ! $this->has_items )
+               if ( $this->has_items ) {
                        _e( 'No themes found.' );
-               else
+               } else {
                        _e( 'You do not appear to have any themes available at this time.' );
+               }
        }
 
        /**
@@ -296,7 +306,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
                        if ( 'search' != $type ) {
                                $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
                                        esc_url( add_query_arg('theme_status', $type, $url) ),
-                                       ( $type == $status ) ? ' class="current"' : '',
+                                       ( $type === $status ) ? ' class="current"' : '',
                                        sprintf( $text, number_format_i18n( $count ) )
                                );
                        }
@@ -459,7 +469,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
        public function column_description( $theme ) {
                global $status, $totals;
                if ( $theme->errors() ) {
-                       $pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
+                       $pre = $status === 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
                        echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
                }