Make WordPress Core

Changeset 34383


Ignore:
Timestamp:
09/22/2015 06:05:39 AM (11 years ago)
Author:
wonderboymusic
Message:

List Tables: when comparing string literals (non-numeric in nature) against vars, strict comparison can/should be used.

Props wonderboymusic, Viper007Bond.
Fixes #21249.

Location:
trunk/src/wp-admin/includes
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r34304 r34383  
    184184                global $comment_status;
    185185
    186                 if ( 'moderated' == $comment_status )
     186                if ( 'moderated' === $comment_status ) {
    187187                        _e( 'No comments awaiting moderation.' );
    188                 else
     188                } else {
    189189                        _e( 'No comments found.' );
     190                }
    190191        }
    191192
     
    219220
    220221                foreach ( $stati as $status => $label ) {
    221                         $class = ( $status == $comment_status ) ? ' class="current"' : '';
     222                        $class = ( $status === $comment_status ) ? ' class="current"' : '';
    222223
    223224                        if ( !isset( $num_comments->$status ) )
     
    265266                        $actions['spam'] = _x( 'Mark as Spam', 'comment' );
    266267
    267                 if ( 'trash' == $comment_status )
     268                if ( 'trash' === $comment_status ) {
    268269                        $actions['untrash'] = __( 'Restore' );
    269                 elseif ( 'spam' == $comment_status )
     270                } elseif ( 'spam' === $comment_status ) {
    270271                        $actions['unspam'] = _x( 'Not Spam', 'comment' );
     272                }
    271273
    272274                if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || !EMPTY_TRASH_DAYS )
     
    290292                <div class="alignleft actions">
    291293<?php
    292                 if ( 'top' == $which ) {
     294                if ( 'top' === $which ) {
    293295?>
    294296                        <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>
     
    322324                }
    323325
    324                 if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) {
     326                if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) ) {
    325327                        wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
    326                         $title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
     328                        $title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
    327329                        submit_button( $title, 'apply', 'delete_all', false );
    328330                }
     
    512514                // Not looking at all comments.
    513515                if ( $comment_status && 'all' != $comment_status ) {
    514                         if ( 'approved' == $the_comment_status ) {
     516                        if ( 'approved' === $the_comment_status ) {
    515517                                $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    516                         } elseif ( 'unapproved' == $the_comment_status ) {
     518                        } elseif ( 'unapproved' === $the_comment_status ) {
    517519                                $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&amp;new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    518520                        }
     
    522524                }
    523525
    524                 if ( 'spam' != $the_comment_status ) {
     526                if ( 'spam' !== $the_comment_status ) {
    525527                        $actions['spam'] = "<a href='$spam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::spam=1' class='vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
    526                 } elseif ( 'spam' == $the_comment_status ) {
     528                } elseif ( 'spam' === $the_comment_status ) {
    527529                        $actions['unspam'] = "<a href='$unspam_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1' class='vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';
    528530                }
    529531
    530                 if ( 'trash' == $the_comment_status ) {
     532                if ( 'trash' === $the_comment_status ) {
    531533                        $actions['untrash'] = "<a href='$untrash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1' class='vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
    532534                }
    533535
    534                 if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
     536                if ( 'spam' === $the_comment_status || 'trash' === $the_comment_status || !EMPTY_TRASH_DAYS ) {
    535537                        $actions['delete'] = "<a href='$delete_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::delete=1' class='delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>';
    536538                } else {
     
    538540                }
    539541
    540                 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
     542                if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) {
    541543                        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>';
    542544
     
    555557                foreach ( $actions as $action => $link ) {
    556558                        ++$i;
    557                         ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
     559                        ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
    558560
    559561                        // Reply and quickedit need a hide-if-no-js span when not added with ajax
    560                         if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') )
     562                        if ( ( 'reply' === $action || 'quickedit' === $action ) && ! defined('DOING_AJAX') )
    561563                                $action .= ' hide-if-no-js';
    562                         elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) {
     564                        elseif ( ( $action === 'untrash' && $the_comment_status === 'trash' ) || ( $action === 'unspam' && $the_comment_status === 'spam' ) ) {
    563565                                if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) )
    564566                                        $action .= ' approve';
     
    670672                        if ( $author_ip ) {
    671673                                $author_ip_url = add_query_arg( array( 's' => $author_ip, 'mode' => 'detail' ), 'edit-comments.php' );
    672                                 if ( 'spam' == $comment_status ) {
     674                                if ( 'spam' === $comment_status ) {
    673675                                        $author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
    674676                                }
     
    711713
    712714                echo '<div class="response-links">';
    713                 if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) ) {
     715                if ( 'attachment' === $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) ) {
    714716                        echo $thumb;
    715717                }
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r34229 r34383  
    284284         */
    285285        public function get_pagination_arg( $key ) {
    286                 if ( 'page' == $key )
     286                if ( 'page' === $key ) {
    287287                        return $this->get_pagenum();
    288 
    289                 if ( isset( $this->_pagination_args[$key] ) )
     288                }
     289
     290                if ( isset( $this->_pagination_args[$key] ) ) {
    290291                        return $this->_pagination_args[$key];
     292                }
    291293        }
    292294
     
    441443
    442444                foreach ( $this->_actions as $name => $title ) {
    443                         $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';
     445                        $class = 'edit' === $name ? ' class="hide-if-no-js"' : '';
    444446
    445447                        echo "\t<option value='$name'$class>$title</option>\n";
     
    599601                        foreach ( $this->modes as $mode => $title ) {
    600602                                $classes = array( 'view-' . $mode );
    601                                 if ( $current_mode == $mode )
     603                                if ( $current_mode === $mode )
    602604                                        $classes[] = 'current';
    603605                                printf(
     
    783785                }
    784786
    785                 if ( 'bottom' == $which ) {
     787                if ( 'bottom' === $which ) {
    786788                        $html_current_page  = $current;
    787789                        $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
     
    10261028                        $current_orderby = '';
    10271029
    1028                 if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
     1030                if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] )
    10291031                        $current_order = 'desc';
    10301032                else
     
    10451047                        }
    10461048
    1047                         if ( 'cb' == $column_key )
     1049                        if ( 'cb' === $column_key )
    10481050                                $class[] = 'check-column';
    10491051                        elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
     
    10571059                                list( $orderby, $desc_first ) = $sortable[$column_key];
    10581060
    1059                                 if ( $current_orderby == $orderby ) {
    1060                                         $order = 'asc' == $current_order ? 'desc' : 'asc';
     1061                                if ( $current_orderby === $orderby ) {
     1062                                        $order = 'asc' === $current_order ? 'desc' : 'asc';
    10611063                                        $class[] = 'sorted';
    10621064                                        $class[] = $current_order;
     
    11371139         */
    11381140        protected function display_tablenav( $which ) {
    1139                 if ( 'top' == $which )
     1141                if ( 'top' === $which ) {
    11401142                        wp_nonce_field( 'bulk-' . $this->_args['plural'] );
    1141 
     1143                }
    11421144                if ( $this->has_items() ) : ?>
    11431145        <div class="tablenav <?php echo esc_attr( $which ); ?>">
     
    12481250                        $attributes = "class='$classes' $data";
    12491251
    1250                         if ( 'cb' == $column_name ) {
     1252                        if ( 'cb' === $column_name ) {
    12511253                                echo '<th scope="row" class="check-column">';
    12521254                                echo $this->column_cb( $item );
     
    12861288         */
    12871289        protected function handle_row_actions( $item, $column_name, $primary ) {
    1288                 return $column_name == $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
     1290                return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
    12891291        }
    12901292
  • trunk/src/wp-admin/includes/class-wp-media-list-table.php

    r34256 r34383  
    6666                list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST );
    6767
    68                 $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' == $_REQUEST['attachment-filter'];
     68                $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter'];
    6969
    7070                $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
     
    106106                                        wp_match_mime_types( $mime_type, str_replace( 'post_mime_type:', '', $filter ) ),
    107107                                true,
    108                                 false   
     108                                false
    109109                        );
    110110
     
    286286
    287287                foreach ( $taxonomies as $taxonomy ) {
    288                         if ( 'category' == $taxonomy )
     288                        if ( 'category' === $taxonomy ) {
    289289                                $column_key = 'categories';
    290                         elseif ( 'post_tag' == $taxonomy )
     290                        } elseif ( 'post_tag' === $taxonomy ) {
    291291                                $column_key = 'tags';
    292                         else
     292                        } else {
    293293                                $column_key = 'taxonomy-' . $taxonomy;
    294 
     294                        }
    295295                        $posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;
    296296                }
     
    427427         */
    428428        public function column_date( $post ) {
    429                 if ( '0000-00-00 00:00:00' == $post->post_date ) {
     429                if ( '0000-00-00 00:00:00' === $post->post_date ) {
    430430                        $h_time = __( 'Unpublished' );
    431431                } else {
     
    527527         */
    528528        public function column_default( $post, $column_name ) {
    529                 if ( 'categories' == $column_name ) {
     529                if ( 'categories' === $column_name ) {
    530530                        $taxonomy = 'category';
    531                 } elseif ( 'tags' == $column_name ) {
     531                } elseif ( 'tags' === $column_name ) {
    532532                        $taxonomy = 'post_tag';
    533533                } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {
     
    590590                        if (
    591591                                ( $this->is_trash && $post->post_status != 'trash' )
    592                                 || ( ! $this->is_trash && $post->post_status == 'trash' )
     592                                || ( ! $this->is_trash && $post->post_status === 'trash' )
    593593                        ) {
    594594                                continue;
  • trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php

    r34289 r34383  
    123123
    124124                $order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
    125                 if ( $order_by == 'registered' ) {
     125                if ( $order_by === 'registered' ) {
    126126                        $query .= ' ORDER BY registered ';
    127                 } elseif ( $order_by == 'lastupdated' ) {
     127                } elseif ( $order_by === 'lastupdated' ) {
    128128                        $query .= ' ORDER BY last_updated ';
    129                 } elseif ( $order_by == 'blogname' ) {
     129                } elseif ( $order_by === 'blogname' ) {
    130130                        if ( is_subdomain_install() ) {
    131131                                $query .= ' ORDER BY domain ';
     
    133133                                $query .= ' ORDER BY path ';
    134134                        }
    135                 } elseif ( $order_by == 'blog_id' ) {
     135                } elseif ( $order_by === 'blog_id' ) {
    136136                        $query .= ' ORDER BY blog_id ';
    137137                } else {
     
    140140
    141141                if ( isset( $order_by ) ) {
    142                         $order = ( isset( $_REQUEST['order'] ) && 'DESC' == strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
     142                        $order = ( isset( $_REQUEST['order'] ) && 'DESC' === strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
    143143                        $query .= $order;
    144144                }
     
    191191                parent::pagination( $which );
    192192
    193                 if ( 'top' == $which )
     193                if ( 'top' === $which )
    194194                        $this->view_switcher( $mode );
    195195        }
     
    321321                global $mode;
    322322
    323                 if ( 'list' == $mode ) {
     323                if ( 'list' === $mode ) {
    324324                        $date = __( 'Y/m/d' );
    325325                } else {
     
    327327                }
    328328
    329                 echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );
     329                echo ( $blog['last_updated'] === '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] );
    330330        }
    331331
     
    341341                global $mode;
    342342
    343                 if ( 'list' == $mode ) {
     343                if ( 'list' === $mode ) {
    344344                        $date = __( 'Y/m/d' );
    345345                } else {
     
    347347                }
    348348
    349                 if ( $blog['registered'] == '0000-00-00 00:00:00' ) {
     349                if ( $blog['registered'] === '0000-00-00 00:00:00' ) {
    350350                        echo '&#x2014;';
    351351                } else {
  • trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php

    r34128 r34383  
    4242                $page = $this->get_pagenum();
    4343
    44                 $this->is_site_themes = ( 'site-themes-network' == $this->screen->id ) ? true : false;
     44                $this->is_site_themes = ( 'site-themes-network' === $this->screen->id ) ? true : false;
    4545
    4646                if ( $this->is_site_themes )
     
    146146                        $order = strtoupper( $order );
    147147
    148                         if ( $orderby == 'Name' ) {
    149                                 if ( 'ASC' == $order )
     148                        if ( $orderby === 'Name' ) {
     149                                if ( 'ASC' === $order ) {
    150150                                        $this->items = array_reverse( $this->items );
     151                                }
    151152                        } else {
    152153                                uasort( $this->items, array( $this, '_order_callback' ) );
     
    207208                        return 0;
    208209
    209                 if ( 'DESC' == $order )
     210                if ( 'DESC' === $order )
    210211                        return ( $a < $b ) ? 1 : -1;
    211212                else
     
    297298                                $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
    298299                                        esc_url( add_query_arg('theme_status', $type, $url) ),
    299                                         ( $type == $status ) ? ' class="current"' : '',
     300                                        ( $type === $status ) ? ' class="current"' : '',
    300301                                        sprintf( $text, number_format_i18n( $count ) )
    301302                                );
     
    460461                global $status, $totals;
    461462                if ( $theme->errors() ) {
    462                         $pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
     463                        $pre = $status === 'broken' ? __( 'Broken Theme:' ) . ' ' : '';
    463464                        echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>';
    464465                }
  • trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php

    r34289 r34383  
    5050                }
    5151
    52                 if ( $role == 'super' ) {
     52                if ( $role === 'super' ) {
    5353                        $logins = implode( "', '", get_super_admins() );
    5454                        $args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" );
     
    123123                $role_links = array();
    124124                $role_links['all'] = "<a href='" . network_admin_url('users.php') . "'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
    125                 $class = $role == 'super' ? ' class="current"' : '';
     125                $class = $role === 'super' ? ' class="current"' : '';
    126126                $role_links['super'] = "<a href='" . network_admin_url('users.php?role=super') . "'$class>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
    127127
     
    138138                parent::pagination ( $which );
    139139
    140                 if ( 'top' == $which )
     140                if ( 'top' === $which ) {
    141141                        $this->view_switcher( $mode );
     142                }
    142143        }
    143144
     
    269270        public function column_registered( $user ) {
    270271                global $mode;
    271                 if ( 'list' == $mode ) {
     272                if ( 'list' === $mode ) {
    272273                        $date = __( 'Y/m/d' );
    273274                } else {
     
    312313                        }
    313314
    314                         $path   = ( $val->path == '/' ) ? '' : $val->path;
     315                        $path   = ( $val->path === '/' ) ? '' : $val->path;
    315316                        echo '<span class="site-' . $val->site_id . '" >';
    316317                        echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . get_current_site()->domain, '', $val->domain . $path ) . '</a>';
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r32656 r34383  
    7878                $tabs = array();
    7979
    80                 if ( 'search' == $tab )
     80                if ( 'search' === $tab ) {
    8181                        $tabs['search'] = __( 'Search Results' );
     82                }
    8283                $tabs['featured']  = _x( 'Featured', 'Plugin Installer' );
    8384                $tabs['popular']   = _x( 'Popular', 'Plugin Installer' );
     
    239240                $display_tabs = array();
    240241                foreach ( (array) $tabs as $action => $text ) {
    241                         $class = ( $action == $tab ) ? ' current' : '';
     242                        $class = ( $action === $tab ) ? ' current' : '';
    242243                        $href = self_admin_url('plugin-install.php?tab=' . $action);
    243244                        $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>";
     
    311312                }
    312313
    313                 if ( 'top' ==  $which ) {
     314                if ( 'top' === $which ) {
    314315                        wp_referer_field();
    315316                ?>
     
    368369                }
    369370
    370                 if ( 'DESC' == $this->order ) {
     371                if ( 'DESC' === $this->order ) {
    371372                        return ( $a < $b ) ? 1 : -1;
    372373                } else {
  • trunk/src/wp-admin/includes/class-wp-plugins-list-table.php

    r34128 r34383  
    258258                        return 0;
    259259
    260                 if ( 'DESC' == $order ) {
     260                if ( 'DESC' === $order ) {
    261261                        return strcasecmp( $b, $a );
    262262                } else {
     
    338338                        }
    339339
    340                         if ( 'search' != $type ) {
     340                        if ( 'search' !== $type ) {
    341341                                $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
    342342                                        add_query_arg('plugin_status', $type, 'plugins.php'),
    343                                         ( $type == $status ) ? ' class="current"' : '',
     343                                        ( $type === $status ) ? ' class="current"' : '',
    344344                                        sprintf( $text, number_format_i18n( $count ) )
    345345                                        );
     
    401401                echo '<div class="alignleft actions">';
    402402
    403                 if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' == $status )
     403                if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' === $status ) {
    404404                        submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false );
    405                 elseif ( 'top' == $which && 'mustuse' == $status )
     405                } elseif ( 'top' === $which && 'mustuse' === $status ) {
    406406                        echo '<p>' . sprintf( __( 'Files in the <code>%s</code> directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '</p>';
    407                 elseif ( 'top' == $which && 'dropins' == $status )
     407                } elseif ( 'top' === $which && 'dropins' === $status ) {
    408408                        echo '<p>' . sprintf( __( 'Drop-ins are advanced plugins in the <code>%s</code> directory that replace WordPress functionality when present.' ), str_replace( ABSPATH, '', WP_CONTENT_DIR ) ) . '</p>';
    409 
     409                }
    410410                echo '</div>';
    411411        }
     
    459459                );
    460460
    461                 if ( 'mustuse' == $context ) {
     461                if ( 'mustuse' === $context ) {
    462462                        $is_active = true;
    463                 } elseif ( 'dropins' == $context ) {
     463                } elseif ( 'dropins' === $context ) {
    464464                        $dropins = _get_dropins();
    465465                        $plugin_name = $plugin_file;
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r34360 r34383  
    9595                }
    9696
    97                 if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
     97                if ( 'post' === $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
    9898                        $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
    9999                        $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status NOT IN ('trash', 'auto-draft') AND ID IN ($sticky_posts)", $post_type ) );
     
    132132                $avail_post_stati = wp_edit_posts_query();
    133133
    134                 $this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' == $wp_query->query['orderby'] );
     134                $this->set_hierarchical_display( is_post_type_hierarchical( $this->screen->post_type ) && 'menu_order title' === $wp_query->query['orderby'] );
    135135
    136136                $post_type = $this->screen->post_type;
     
    162162
    163163                if ( ! empty( $_REQUEST['mode'] ) ) {
    164                         $mode = $_REQUEST['mode'] == 'excerpt' ? 'excerpt' : 'list';
     164                        $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list';
    165165                        set_user_setting ( 'posts_list_mode', $mode );
    166166                } else {
     
    168168                }
    169169
    170                 $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] == 'trash';
     170                $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash';
    171171
    172172                $this->set_pagination_args( array(
     
    189189         */
    190190        public function no_items() {
    191                 if ( isset( $_REQUEST['post_status'] ) && 'trash' == $_REQUEST['post_status'] )
     191                if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] )
    192192                        echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash;
    193193                else
     
    205205                $vars = $_GET;
    206206                unset( $vars['paged'] );
    207                
     207
    208208                if ( empty( $vars ) ) {
    209209                        return true;
     
    327327                        }
    328328
    329                         if ( isset($_REQUEST['post_status']) && $status_name == $_REQUEST['post_status'] ) {
     329                        if ( isset($_REQUEST['post_status']) && $status_name === $_REQUEST['post_status'] ) {
    330330                                $class = 'current';
    331331                        }
     
    410410                <div class="alignleft actions">
    411411<?php
    412                 if ( 'top' == $which && !is_singular() ) {
     412                if ( 'top' === $which && !is_singular() ) {
    413413
    414414                        $this->months_dropdown( $this->screen->post_type );
     
    472472                parent::pagination( $which );
    473473
    474                 if ( 'top' == $which && ! is_post_type_hierarchical( $this->screen->post_type ) )
     474                if ( 'top' === $which && ! is_post_type_hierarchical( $this->screen->post_type ) )
    475475                        $this->view_switcher( $mode );
    476476        }
     
    520520
    521521                foreach ( $taxonomies as $taxonomy ) {
    522                         if ( 'category' == $taxonomy )
     522                        if ( 'category' === $taxonomy )
    523523                                $column_key = 'categories';
    524                         elseif ( 'post_tag' == $taxonomy )
     524                        elseif ( 'post_tag' === $taxonomy )
    525525                                $column_key = 'tags';
    526526                        else
     
    536536                $posts_columns['date'] = __( 'Date' );
    537537
    538                 if ( 'page' == $post_type ) {
     538                if ( 'page' === $post_type ) {
    539539
    540540                        /**
     
    901901                }
    902902
    903                 if ( ! is_post_type_hierarchical( $this->screen->post_type ) && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) ) {
     903                if ( ! is_post_type_hierarchical( $this->screen->post_type ) && 'excerpt' === $mode && current_user_can( 'read_post', $post->ID ) ) {
    904904                        the_excerpt();
    905905                }
     
    921921                global $mode;
    922922
    923                 if ( '0000-00-00 00:00:00' == $post->post_date ) {
     923                if ( '0000-00-00 00:00:00' === $post->post_date ) {
    924924                        $t_time = $h_time = __( 'Unpublished' );
    925925                        $time_diff = 0;
     
    938938                }
    939939
    940                 if ( 'publish' == $post->post_status ) {
     940                if ( 'publish' === $post->post_status ) {
    941941                        _e( 'Published' );
    942                 } elseif ( 'future' == $post->post_status ) {
     942                } elseif ( 'future' === $post->post_status ) {
    943943                        if ( $time_diff > 0 ) {
    944944                                echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>';
     
    950950                }
    951951                echo '<br />';
    952                 if ( 'excerpt' == $mode ) {
     952                if ( 'excerpt' === $mode ) {
    953953                        /**
    954954                         * Filter the published time of the post.
     
    10191019         */
    10201020        public function column_default( $post, $column_name ) {
    1021                 if ( 'categories' == $column_name ) {
     1021                if ( 'categories' === $column_name ) {
    10221022                        $taxonomy = 'category';
    1023                 } elseif ( 'tags' == $column_name ) {
     1023                } elseif ( 'tags' === $column_name ) {
    10241024                        $taxonomy = 'post_tag';
    10251025                } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) {
     
    11731173
    11741174                if ( current_user_can( 'delete_post', $post->ID ) ) {
    1175                         if ( 'trash' == $post->post_status )
     1175                        if ( 'trash' === $post->post_status )
    11761176                                $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
    11771177                        elseif ( EMPTY_TRASH_DAYS )
    11781178                                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash' ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
    1179                         if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
     1179                        if ( 'trash' === $post->post_status || !EMPTY_TRASH_DAYS )
    11801180                                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
    11811181                }
     
    12721272                }
    12731273
    1274                 $m = ( isset( $mode ) && 'excerpt' == $mode ) ? 'excerpt' : 'list';
     1274                $m = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list';
    12751275                $can_publish = current_user_can( $post_type_object->cap->publish_posts );
    12761276                $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true );
     
    13801380
    13811381                        <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
    1382                         <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
     1382                        <input type="hidden" name="<?php echo ( $taxonomy->name === 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
    13831383                        <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist">
    13841384                                <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?>
     
    14431443        <?php   endif; // !$bulk
    14441444
    1445                         if ( 'page' == $screen->post_type ) :
     1445                        if ( 'page' === $screen->post_type ) :
    14461446        ?>
    14471447
     
    15431543                                </label>
    15441544
    1545         <?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
     1545        <?php if ( 'post' === $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
    15461546
    15471547        <?php   if ( $bulk ) : ?>
  • trunk/src/wp-admin/includes/class-wp-terms-list-table.php

    r34319 r34383  
    7070                $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );
    7171
    72                 if ( 'post_tag' == $this->screen->taxonomy ) {
     72                if ( 'post_tag' === $this->screen->taxonomy ) {
    7373                        /**
    7474                         * Filter the number of terms displayed per page for the Tags list table.
     
    8989                         */
    9090                        $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page );
    91                 } elseif ( 'category' == $this->screen->taxonomy ) {
     91                } elseif ( 'category' === $this->screen->taxonomy ) {
    9292                        /**
    9393                         * Filter the number of terms displayed per page for the Categories list table.
     
    154154         */
    155155        public function current_action() {
    156                 if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' == $_REQUEST['action'] || 'delete' == $_REQUEST['action2'] ) )
     156                if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' === $_REQUEST['action'] || 'delete' === $_REQUEST['action2'] ) )
    157157                        return 'bulk-delete';
    158158
     
    172172                );
    173173
    174                 if ( 'link_category' == $this->screen->taxonomy ) {
     174                if ( 'link_category' === $this->screen->taxonomy ) {
    175175                        $columns['links'] = __( 'Links' );
    176176                } else {
     
    497497                        $args['post_type'] = $this->screen->post_type;
    498498
    499                 if ( 'attachment' == $this->screen->post_type )
     499                if ( 'attachment' === $this->screen->post_type )
    500500                        return "<a href='" . esc_url ( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>";
    501501
  • trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php

    r33153 r34383  
    5151                $tabs = array();
    5252                $tabs['dashboard'] = __( 'Search' );
    53                 if ( 'search' == $tab )
     53                if ( 'search' === $tab )
    5454                        $tabs['search'] = __( 'Search Results' );
    5555                $tabs['upload'] = __( 'Upload' );
     
    164164                $display_tabs = array();
    165165                foreach ( (array) $tabs as $action => $text ) {
    166                         $class = ( $action == $tab ) ? ' class="current"' : '';
     166                        $class = ( $action === $tab ) ? ' class="current"' : '';
    167167                        $href = self_admin_url('theme-install.php?tab=' . $action);
    168168                        $display_tabs['theme-install-'.$action] = "<a href='$href'$class>$text</a>";
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r34133 r34383  
    4646                ) );
    4747
    48                 $this->is_site_users = 'site-users-network' == $this->screen->id;
     48                $this->is_site_users = 'site-users-network' === $this->screen->id;
    4949
    5050                if ( $this->is_site_users )
     
    170170                        $class = '';
    171171
    172                         if ( $this_role == $role ) {
     172                        if ( $this_role === $role ) {
    173173                                $class = ' class="current"';
    174174                        }
Note: See TracChangeset for help on using the changeset viewer.