Changeset 34383
- Timestamp:
- 09/22/2015 06:05:39 AM (9 years ago)
- 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 184 184 global $comment_status; 185 185 186 if ( 'moderated' == $comment_status )186 if ( 'moderated' === $comment_status ) { 187 187 _e( 'No comments awaiting moderation.' ); 188 else188 } else { 189 189 _e( 'No comments found.' ); 190 } 190 191 } 191 192 … … 219 220 220 221 foreach ( $stati as $status => $label ) { 221 $class = ( $status == $comment_status ) ? ' class="current"' : '';222 $class = ( $status === $comment_status ) ? ' class="current"' : ''; 222 223 223 224 if ( !isset( $num_comments->$status ) ) … … 265 266 $actions['spam'] = _x( 'Mark as Spam', 'comment' ); 266 267 267 if ( 'trash' == $comment_status )268 if ( 'trash' === $comment_status ) { 268 269 $actions['untrash'] = __( 'Restore' ); 269 elseif ( 'spam' == $comment_status )270 } elseif ( 'spam' === $comment_status ) { 270 271 $actions['unspam'] = _x( 'Not Spam', 'comment' ); 272 } 271 273 272 274 if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || !EMPTY_TRASH_DAYS ) … … 290 292 <div class="alignleft actions"> 291 293 <?php 292 if ( 'top' == $which ) {294 if ( 'top' === $which ) { 293 295 ?> 294 296 <label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label> … … 322 324 } 323 325 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' ) ) { 325 327 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' ); 327 329 submit_button( $title, 'apply', 'delete_all', false ); 328 330 } … … 512 514 // Not looking at all comments. 513 515 if ( $comment_status && 'all' != $comment_status ) { 514 if ( 'approved' == $the_comment_status ) {516 if ( 'approved' === $the_comment_status ) { 515 517 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&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 ) { 517 519 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 518 520 } … … 522 524 } 523 525 524 if ( 'spam' != $the_comment_status ) {526 if ( 'spam' !== $the_comment_status ) { 525 527 $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 ) { 527 529 $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>'; 528 530 } 529 531 530 if ( 'trash' == $the_comment_status ) {532 if ( 'trash' === $the_comment_status ) { 531 533 $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>'; 532 534 } 533 535 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 ) { 535 537 $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>'; 536 538 } else { … … 538 540 } 539 541 540 if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {542 if ( 'spam' !== $the_comment_status && 'trash' !== $the_comment_status ) { 541 543 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>'; 542 544 … … 555 557 foreach ( $actions as $action => $link ) { 556 558 ++$i; 557 ( ( ( 'approve' == $action || 'unapprove'== $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';559 ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; 558 560 559 561 // 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') ) 561 563 $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' ) ) { 563 565 if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) ) 564 566 $action .= ' approve'; … … 670 672 if ( $author_ip ) { 671 673 $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 ) { 673 675 $author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url ); 674 676 } … … 711 713 712 714 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 ) ) ) { 714 716 echo $thumb; 715 717 } -
trunk/src/wp-admin/includes/class-wp-list-table.php
r34229 r34383 284 284 */ 285 285 public function get_pagination_arg( $key ) { 286 if ( 'page' == $key )286 if ( 'page' === $key ) { 287 287 return $this->get_pagenum(); 288 289 if ( isset( $this->_pagination_args[$key] ) ) 288 } 289 290 if ( isset( $this->_pagination_args[$key] ) ) { 290 291 return $this->_pagination_args[$key]; 292 } 291 293 } 292 294 … … 441 443 442 444 foreach ( $this->_actions as $name => $title ) { 443 $class = 'edit' == $name ? ' class="hide-if-no-js"' : '';445 $class = 'edit' === $name ? ' class="hide-if-no-js"' : ''; 444 446 445 447 echo "\t<option value='$name'$class>$title</option>\n"; … … 599 601 foreach ( $this->modes as $mode => $title ) { 600 602 $classes = array( 'view-' . $mode ); 601 if ( $current_mode == $mode )603 if ( $current_mode === $mode ) 602 604 $classes[] = 'current'; 603 605 printf( … … 783 785 } 784 786 785 if ( 'bottom' == $which ) {787 if ( 'bottom' === $which ) { 786 788 $html_current_page = $current; 787 789 $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">'; … … 1026 1028 $current_orderby = ''; 1027 1029 1028 if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )1030 if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) 1029 1031 $current_order = 'desc'; 1030 1032 else … … 1045 1047 } 1046 1048 1047 if ( 'cb' == $column_key )1049 if ( 'cb' === $column_key ) 1048 1050 $class[] = 'check-column'; 1049 1051 elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) … … 1057 1059 list( $orderby, $desc_first ) = $sortable[$column_key]; 1058 1060 1059 if ( $current_orderby == $orderby ) {1060 $order = 'asc' == $current_order ? 'desc' : 'asc';1061 if ( $current_orderby === $orderby ) { 1062 $order = 'asc' === $current_order ? 'desc' : 'asc'; 1061 1063 $class[] = 'sorted'; 1062 1064 $class[] = $current_order; … … 1137 1139 */ 1138 1140 protected function display_tablenav( $which ) { 1139 if ( 'top' == $which )1141 if ( 'top' === $which ) { 1140 1142 wp_nonce_field( 'bulk-' . $this->_args['plural'] ); 1141 1143 } 1142 1144 if ( $this->has_items() ) : ?> 1143 1145 <div class="tablenav <?php echo esc_attr( $which ); ?>"> … … 1248 1250 $attributes = "class='$classes' $data"; 1249 1251 1250 if ( 'cb' == $column_name ) {1252 if ( 'cb' === $column_name ) { 1251 1253 echo '<th scope="row" class="check-column">'; 1252 1254 echo $this->column_cb( $item ); … … 1286 1288 */ 1287 1289 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>' : ''; 1289 1291 } 1290 1292 -
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r34256 r34383 66 66 list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $_REQUEST ); 67 67 68 $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' == $_REQUEST['attachment-filter'];68 $this->is_trash = isset( $_REQUEST['attachment-filter'] ) && 'trash' === $_REQUEST['attachment-filter']; 69 69 70 70 $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode']; … … 106 106 wp_match_mime_types( $mime_type, str_replace( 'post_mime_type:', '', $filter ) ), 107 107 true, 108 false 108 false 109 109 ); 110 110 … … 286 286 287 287 foreach ( $taxonomies as $taxonomy ) { 288 if ( 'category' == $taxonomy )288 if ( 'category' === $taxonomy ) { 289 289 $column_key = 'categories'; 290 elseif ( 'post_tag' == $taxonomy )290 } elseif ( 'post_tag' === $taxonomy ) { 291 291 $column_key = 'tags'; 292 else292 } else { 293 293 $column_key = 'taxonomy-' . $taxonomy; 294 294 } 295 295 $posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name; 296 296 } … … 427 427 */ 428 428 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 ) { 430 430 $h_time = __( 'Unpublished' ); 431 431 } else { … … 527 527 */ 528 528 public function column_default( $post, $column_name ) { 529 if ( 'categories' == $column_name ) {529 if ( 'categories' === $column_name ) { 530 530 $taxonomy = 'category'; 531 } elseif ( 'tags' == $column_name ) {531 } elseif ( 'tags' === $column_name ) { 532 532 $taxonomy = 'post_tag'; 533 533 } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) { … … 590 590 if ( 591 591 ( $this->is_trash && $post->post_status != 'trash' ) 592 || ( ! $this->is_trash && $post->post_status == 'trash' )592 || ( ! $this->is_trash && $post->post_status === 'trash' ) 593 593 ) { 594 594 continue; -
trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php
r34289 r34383 123 123 124 124 $order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : ''; 125 if ( $order_by == 'registered' ) {125 if ( $order_by === 'registered' ) { 126 126 $query .= ' ORDER BY registered '; 127 } elseif ( $order_by == 'lastupdated' ) {127 } elseif ( $order_by === 'lastupdated' ) { 128 128 $query .= ' ORDER BY last_updated '; 129 } elseif ( $order_by == 'blogname' ) {129 } elseif ( $order_by === 'blogname' ) { 130 130 if ( is_subdomain_install() ) { 131 131 $query .= ' ORDER BY domain '; … … 133 133 $query .= ' ORDER BY path '; 134 134 } 135 } elseif ( $order_by == 'blog_id' ) {135 } elseif ( $order_by === 'blog_id' ) { 136 136 $query .= ' ORDER BY blog_id '; 137 137 } else { … … 140 140 141 141 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"; 143 143 $query .= $order; 144 144 } … … 191 191 parent::pagination( $which ); 192 192 193 if ( 'top' == $which )193 if ( 'top' === $which ) 194 194 $this->view_switcher( $mode ); 195 195 } … … 321 321 global $mode; 322 322 323 if ( 'list' == $mode ) {323 if ( 'list' === $mode ) { 324 324 $date = __( 'Y/m/d' ); 325 325 } else { … … 327 327 } 328 328 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'] ); 330 330 } 331 331 … … 341 341 global $mode; 342 342 343 if ( 'list' == $mode ) {343 if ( 'list' === $mode ) { 344 344 $date = __( 'Y/m/d' ); 345 345 } else { … … 347 347 } 348 348 349 if ( $blog['registered'] == '0000-00-00 00:00:00' ) {349 if ( $blog['registered'] === '0000-00-00 00:00:00' ) { 350 350 echo '—'; 351 351 } else { -
trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php
r34128 r34383 42 42 $page = $this->get_pagenum(); 43 43 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; 45 45 46 46 if ( $this->is_site_themes ) … … 146 146 $order = strtoupper( $order ); 147 147 148 if ( $orderby == 'Name' ) {149 if ( 'ASC' == $order )148 if ( $orderby === 'Name' ) { 149 if ( 'ASC' === $order ) { 150 150 $this->items = array_reverse( $this->items ); 151 } 151 152 } else { 152 153 uasort( $this->items, array( $this, '_order_callback' ) ); … … 207 208 return 0; 208 209 209 if ( 'DESC' == $order )210 if ( 'DESC' === $order ) 210 211 return ( $a < $b ) ? 1 : -1; 211 212 else … … 297 298 $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>", 298 299 esc_url( add_query_arg('theme_status', $type, $url) ), 299 ( $type == $status ) ? ' class="current"' : '',300 ( $type === $status ) ? ' class="current"' : '', 300 301 sprintf( $text, number_format_i18n( $count ) ) 301 302 ); … … 460 461 global $status, $totals; 461 462 if ( $theme->errors() ) { 462 $pre = $status == 'broken' ? __( 'Broken Theme:' ) . ' ' : '';463 $pre = $status === 'broken' ? __( 'Broken Theme:' ) . ' ' : ''; 463 464 echo '<p><strong class="error-message">' . $pre . $theme->errors()->get_error_message() . '</strong></p>'; 464 465 } -
trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php
r34289 r34383 50 50 } 51 51 52 if ( $role == 'super' ) {52 if ( $role === 'super' ) { 53 53 $logins = implode( "', '", get_super_admins() ); 54 54 $args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" ); … … 123 123 $role_links = array(); 124 124 $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"' : ''; 126 126 $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>'; 127 127 … … 138 138 parent::pagination ( $which ); 139 139 140 if ( 'top' == $which )140 if ( 'top' === $which ) { 141 141 $this->view_switcher( $mode ); 142 } 142 143 } 143 144 … … 269 270 public function column_registered( $user ) { 270 271 global $mode; 271 if ( 'list' == $mode ) {272 if ( 'list' === $mode ) { 272 273 $date = __( 'Y/m/d' ); 273 274 } else { … … 312 313 } 313 314 314 $path = ( $val->path == '/' ) ? '' : $val->path;315 $path = ( $val->path === '/' ) ? '' : $val->path; 315 316 echo '<span class="site-' . $val->site_id . '" >'; 316 317 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 78 78 $tabs = array(); 79 79 80 if ( 'search' == $tab )80 if ( 'search' === $tab ) { 81 81 $tabs['search'] = __( 'Search Results' ); 82 } 82 83 $tabs['featured'] = _x( 'Featured', 'Plugin Installer' ); 83 84 $tabs['popular'] = _x( 'Popular', 'Plugin Installer' ); … … 239 240 $display_tabs = array(); 240 241 foreach ( (array) $tabs as $action => $text ) { 241 $class = ( $action == $tab ) ? ' current' : '';242 $class = ( $action === $tab ) ? ' current' : ''; 242 243 $href = self_admin_url('plugin-install.php?tab=' . $action); 243 244 $display_tabs['plugin-install-'.$action] = "<a href='$href' class='$class'>$text</a>"; … … 311 312 } 312 313 313 if ( 'top' == 314 if ( 'top' === $which ) { 314 315 wp_referer_field(); 315 316 ?> … … 368 369 } 369 370 370 if ( 'DESC' == $this->order ) {371 if ( 'DESC' === $this->order ) { 371 372 return ( $a < $b ) ? 1 : -1; 372 373 } else { -
trunk/src/wp-admin/includes/class-wp-plugins-list-table.php
r34128 r34383 258 258 return 0; 259 259 260 if ( 'DESC' == $order ) {260 if ( 'DESC' === $order ) { 261 261 return strcasecmp( $b, $a ); 262 262 } else { … … 338 338 } 339 339 340 if ( 'search' != $type ) {340 if ( 'search' !== $type ) { 341 341 $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>", 342 342 add_query_arg('plugin_status', $type, 'plugins.php'), 343 ( $type == $status ) ? ' class="current"' : '',343 ( $type === $status ) ? ' class="current"' : '', 344 344 sprintf( $text, number_format_i18n( $count ) ) 345 345 ); … … 401 401 echo '<div class="alignleft actions">'; 402 402 403 if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' == $status )403 if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' === $status ) { 404 404 submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false ); 405 elseif ( 'top' == $which && 'mustuse' == $status )405 } elseif ( 'top' === $which && 'mustuse' === $status ) { 406 406 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 ) { 408 408 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 } 410 410 echo '</div>'; 411 411 } … … 459 459 ); 460 460 461 if ( 'mustuse' == $context ) {461 if ( 'mustuse' === $context ) { 462 462 $is_active = true; 463 } elseif ( 'dropins' == $context ) {463 } elseif ( 'dropins' === $context ) { 464 464 $dropins = _get_dropins(); 465 465 $plugin_name = $plugin_file; -
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r34360 r34383 95 95 } 96 96 97 if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {97 if ( 'post' === $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) { 98 98 $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) ); 99 99 $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 ) ); … … 132 132 $avail_post_stati = wp_edit_posts_query(); 133 133 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'] ); 135 135 136 136 $post_type = $this->screen->post_type; … … 162 162 163 163 if ( ! empty( $_REQUEST['mode'] ) ) { 164 $mode = $_REQUEST['mode'] == 'excerpt' ? 'excerpt' : 'list';164 $mode = $_REQUEST['mode'] === 'excerpt' ? 'excerpt' : 'list'; 165 165 set_user_setting ( 'posts_list_mode', $mode ); 166 166 } else { … … 168 168 } 169 169 170 $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] == 'trash';170 $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash'; 171 171 172 172 $this->set_pagination_args( array( … … 189 189 */ 190 190 public function no_items() { 191 if ( isset( $_REQUEST['post_status'] ) && 'trash' == $_REQUEST['post_status'] )191 if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) 192 192 echo get_post_type_object( $this->screen->post_type )->labels->not_found_in_trash; 193 193 else … … 205 205 $vars = $_GET; 206 206 unset( $vars['paged'] ); 207 207 208 208 if ( empty( $vars ) ) { 209 209 return true; … … 327 327 } 328 328 329 if ( isset($_REQUEST['post_status']) && $status_name == $_REQUEST['post_status'] ) {329 if ( isset($_REQUEST['post_status']) && $status_name === $_REQUEST['post_status'] ) { 330 330 $class = 'current'; 331 331 } … … 410 410 <div class="alignleft actions"> 411 411 <?php 412 if ( 'top' == $which && !is_singular() ) {412 if ( 'top' === $which && !is_singular() ) { 413 413 414 414 $this->months_dropdown( $this->screen->post_type ); … … 472 472 parent::pagination( $which ); 473 473 474 if ( 'top' == $which && ! is_post_type_hierarchical( $this->screen->post_type ) )474 if ( 'top' === $which && ! is_post_type_hierarchical( $this->screen->post_type ) ) 475 475 $this->view_switcher( $mode ); 476 476 } … … 520 520 521 521 foreach ( $taxonomies as $taxonomy ) { 522 if ( 'category' == $taxonomy )522 if ( 'category' === $taxonomy ) 523 523 $column_key = 'categories'; 524 elseif ( 'post_tag' == $taxonomy )524 elseif ( 'post_tag' === $taxonomy ) 525 525 $column_key = 'tags'; 526 526 else … … 536 536 $posts_columns['date'] = __( 'Date' ); 537 537 538 if ( 'page' == $post_type ) {538 if ( 'page' === $post_type ) { 539 539 540 540 /** … … 901 901 } 902 902 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 ) ) { 904 904 the_excerpt(); 905 905 } … … 921 921 global $mode; 922 922 923 if ( '0000-00-00 00:00:00' == $post->post_date ) {923 if ( '0000-00-00 00:00:00' === $post->post_date ) { 924 924 $t_time = $h_time = __( 'Unpublished' ); 925 925 $time_diff = 0; … … 938 938 } 939 939 940 if ( 'publish' == $post->post_status ) {940 if ( 'publish' === $post->post_status ) { 941 941 _e( 'Published' ); 942 } elseif ( 'future' == $post->post_status ) {942 } elseif ( 'future' === $post->post_status ) { 943 943 if ( $time_diff > 0 ) { 944 944 echo '<strong class="error-message">' . __( 'Missed schedule' ) . '</strong>'; … … 950 950 } 951 951 echo '<br />'; 952 if ( 'excerpt' == $mode ) {952 if ( 'excerpt' === $mode ) { 953 953 /** 954 954 * Filter the published time of the post. … … 1019 1019 */ 1020 1020 public function column_default( $post, $column_name ) { 1021 if ( 'categories' == $column_name ) {1021 if ( 'categories' === $column_name ) { 1022 1022 $taxonomy = 'category'; 1023 } elseif ( 'tags' == $column_name ) {1023 } elseif ( 'tags' === $column_name ) { 1024 1024 $taxonomy = 'post_tag'; 1025 1025 } elseif ( 0 === strpos( $column_name, 'taxonomy-' ) ) { … … 1173 1173 1174 1174 if ( current_user_can( 'delete_post', $post->ID ) ) { 1175 if ( 'trash' == $post->post_status )1175 if ( 'trash' === $post->post_status ) 1176 1176 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash' ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>"; 1177 1177 elseif ( EMPTY_TRASH_DAYS ) 1178 1178 $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 ) 1180 1180 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently' ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>"; 1181 1181 } … … 1272 1272 } 1273 1273 1274 $m = ( isset( $mode ) && 'excerpt' == $mode ) ? 'excerpt' : 'list';1274 $m = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list'; 1275 1275 $can_publish = current_user_can( $post_type_object->cap->publish_posts ); 1276 1276 $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true ); … … 1380 1380 1381 1381 <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" /> 1383 1383 <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist"> 1384 1384 <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?> … … 1443 1443 <?php endif; // !$bulk 1444 1444 1445 if ( 'page' == $screen->post_type ) :1445 if ( 'page' === $screen->post_type ) : 1446 1446 ?> 1447 1447 … … 1543 1543 </label> 1544 1544 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 ) ) : ?> 1546 1546 1547 1547 <?php if ( $bulk ) : ?> -
trunk/src/wp-admin/includes/class-wp-terms-list-table.php
r34319 r34383 70 70 $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' ); 71 71 72 if ( 'post_tag' == $this->screen->taxonomy ) {72 if ( 'post_tag' === $this->screen->taxonomy ) { 73 73 /** 74 74 * Filter the number of terms displayed per page for the Tags list table. … … 89 89 */ 90 90 $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); 91 } elseif ( 'category' == $this->screen->taxonomy ) {91 } elseif ( 'category' === $this->screen->taxonomy ) { 92 92 /** 93 93 * Filter the number of terms displayed per page for the Categories list table. … … 154 154 */ 155 155 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'] ) ) 157 157 return 'bulk-delete'; 158 158 … … 172 172 ); 173 173 174 if ( 'link_category' == $this->screen->taxonomy ) {174 if ( 'link_category' === $this->screen->taxonomy ) { 175 175 $columns['links'] = __( 'Links' ); 176 176 } else { … … 497 497 $args['post_type'] = $this->screen->post_type; 498 498 499 if ( 'attachment' == $this->screen->post_type )499 if ( 'attachment' === $this->screen->post_type ) 500 500 return "<a href='" . esc_url ( add_query_arg( $args, 'upload.php' ) ) . "'>$count</a>"; 501 501 -
trunk/src/wp-admin/includes/class-wp-theme-install-list-table.php
r33153 r34383 51 51 $tabs = array(); 52 52 $tabs['dashboard'] = __( 'Search' ); 53 if ( 'search' == $tab )53 if ( 'search' === $tab ) 54 54 $tabs['search'] = __( 'Search Results' ); 55 55 $tabs['upload'] = __( 'Upload' ); … … 164 164 $display_tabs = array(); 165 165 foreach ( (array) $tabs as $action => $text ) { 166 $class = ( $action == $tab ) ? ' class="current"' : '';166 $class = ( $action === $tab ) ? ' class="current"' : ''; 167 167 $href = self_admin_url('theme-install.php?tab=' . $action); 168 168 $display_tabs['theme-install-'.$action] = "<a href='$href'$class>$text</a>"; -
trunk/src/wp-admin/includes/class-wp-users-list-table.php
r34133 r34383 46 46 ) ); 47 47 48 $this->is_site_users = 'site-users-network' == $this->screen->id;48 $this->is_site_users = 'site-users-network' === $this->screen->id; 49 49 50 50 if ( $this->is_site_users ) … … 170 170 $class = ''; 171 171 172 if ( $this_role == $role ) {172 if ( $this_role === $role ) { 173 173 $class = ' class="current"'; 174 174 }
Note: See TracChangeset
for help on using the changeset viewer.