Changeset 47785
- Timestamp:
- 05/12/2020 06:30:03 PM (5 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin-header.php
r47771 r47785 45 45 } 46 46 47 if ( $admin_title == $title ) {47 if ( $admin_title === $title ) { 48 48 /* translators: Admin screen title. %s: Admin screen name. */ 49 49 $admin_title = sprintf( __( '%s — WordPress' ), $title ); … … 148 148 do_action( 'admin_head' ); 149 149 150 if ( get_user_setting( 'mfold' ) == 'f' ) {150 if ( get_user_setting( 'mfold' ) === 'f' ) { 151 151 $admin_body_class .= ' folded'; 152 152 } -
trunk/src/wp-admin/admin.php
r47233 r47785 46 46 */ 47 47 do_action( 'after_db_upgrade' ); 48 } elseif ( get_option( 'db_version' ) != $wp_db_version && empty( $_POST ) ) {48 } elseif ( get_option( 'db_version' ) !== $wp_db_version && empty( $_POST ) ) { 49 49 if ( ! is_multisite() ) { 50 50 wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ); -
trunk/src/wp-admin/async-upload.php
r47198 r47785 43 43 $id = intval( $_REQUEST['attachment_id'] ); 44 44 $post = get_post( $id ); 45 if ( 'attachment' != $post->post_type ) {45 if ( 'attachment' !== $post->post_type ) { 46 46 wp_die( __( 'Invalid post type.' ) ); 47 47 } -
trunk/src/wp-admin/comment.php
r47550 r47785 23 23 } 24 24 25 if ( 'cdc' == $action ) {25 if ( 'cdc' === $action ) { 26 26 $action = 'delete'; 27 } elseif ( 'mac' == $action ) {27 } elseif ( 'mac' === $action ) { 28 28 $action = 'approve'; 29 29 } 30 30 31 31 if ( isset( $_GET['dt'] ) ) { 32 if ( 'spam' == $_GET['dt'] ) {32 if ( 'spam' === $_GET['dt'] ) { 33 33 $action = 'spam'; 34 } elseif ( 'trash' == $_GET['dt'] ) {34 } elseif ( 'trash' === $_GET['dt'] ) { 35 35 $action = 'trash'; 36 36 } … … 72 72 } 73 73 74 if ( 'trash' == $comment->comment_approved ) {74 if ( 'trash' === $comment->comment_approved ) { 75 75 comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) ); 76 76 } … … 102 102 103 103 // No need to re-approve/re-trash/re-spam a comment. 104 if ( str_replace( '1', 'approve', $comment->comment_approved ) == $action ) {104 if ( str_replace( '1', 'approve', $comment->comment_approved ) === $action ) { 105 105 wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) ); 106 106 die(); … … 110 110 111 111 $formaction = $action . 'comment'; 112 $nonce_action = 'approve' == $action? 'approve-comment_' : 'delete-comment_';112 $nonce_action = ( 'approve' === $action ) ? 'approve-comment_' : 'delete-comment_'; 113 113 $nonce_action .= $comment_id; 114 114 … … 138 138 } 139 139 140 if ( '0' != $comment->comment_approved ) { // If not unapproved.140 if ( '0' !== $comment->comment_approved ) { // If not unapproved. 141 141 $message = ''; 142 142 switch ( $comment->comment_approved ) { … … 272 272 } 273 273 274 if ( '' !=wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) {274 if ( wp_get_referer() && ! $noredir && false === strpos( wp_get_referer(), 'comment.php' ) ) { 275 275 $redir = wp_get_referer(); 276 } elseif ( '' !=wp_get_original_referer() && ! $noredir ) {276 } elseif ( wp_get_original_referer() && ! $noredir ) { 277 277 $redir = wp_get_original_referer(); 278 278 } elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) { … … 349 349 */ 350 350 $location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); 351 351 352 wp_redirect( $location ); 352 353 exit(); 353 exit; 354 354 355 355 default: -
trunk/src/wp-admin/edit-comments.php
r47219 r47785 25 25 check_admin_referer( 'bulk-comments' ); 26 26 27 if ( 'delete_all' == $doaction && ! empty( $_REQUEST['pagegen_timestamp'] ) ) {27 if ( 'delete_all' === $doaction && ! empty( $_REQUEST['pagegen_timestamp'] ) ) { 28 28 $comment_status = wp_unslash( $_REQUEST['comment_status'] ); 29 29 $delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] ); … … 32 32 } elseif ( isset( $_REQUEST['delete_comments'] ) ) { 33 33 $comment_ids = $_REQUEST['delete_comments']; 34 $doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];34 $doaction = ( '-1' !== $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2']; 35 35 } elseif ( isset( $_REQUEST['ids'] ) ) { 36 36 $comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) ); -
trunk/src/wp-admin/edit-form-advanced.php
r47410 r47785 77 77 $action = isset( $action ) ? $action : ''; 78 78 79 if ( get_option( 'page_for_posts' )== $post_ID && empty( $post->post_content ) ) {79 if ( (int) get_option( 'page_for_posts' ) === $post_ID && empty( $post->post_content ) ) { 80 80 add_action( 'edit_form_after_title', '_wp_posts_page_notice' ); 81 81 remove_post_type_support( $post_type, 'editor' ); … … 229 229 $notice = false; 230 230 $form_extra = ''; 231 if ( 'auto-draft' == $post->post_status ) {232 if ( 'edit' == $action ) {231 if ( 'auto-draft' === $post->post_status ) { 232 if ( 'edit' === $action ) { 233 233 $post->post_title = ''; 234 234 } … … 277 277 ); 278 278 279 if ( 'post' == $post_type ) {279 if ( 'post' === $post_type ) { 280 280 $customize_display = '<p>' . __( 'The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.' ) . '</p>'; 281 281 … … 314 314 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' 315 315 ); 316 } elseif ( 'page' == $post_type ) {316 } elseif ( 'page' === $post_type ) { 317 317 $about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.' ) . '</p>' . 318 318 '<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>'; … … 332 332 '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>' 333 333 ); 334 } elseif ( 'attachment' == $post_type ) {334 } elseif ( 'attachment' === $post_type ) { 335 335 get_current_screen()->add_help_tab( 336 336 array( … … 352 352 } 353 353 354 if ( 'post' == $post_type || 'page'== $post_type ) {354 if ( 'post' === $post_type || 'page' === $post_type ) { 355 355 $inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>'; 356 356 $inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. <a href="https://wordpress.org/support/article/embeds/">Learn more about embeds</a>.' ) . '</p>'; … … 365 365 } 366 366 367 if ( 'post' == $post_type ) {367 if ( 'post' === $post_type ) { 368 368 $publish_box = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>'; 369 369 $publish_box .= '<ul><li>' . … … 403 403 ) 404 404 ); 405 } elseif ( 'page' == $post_type ) {405 } elseif ( 'page' === $post_type ) { 406 406 $page_attributes = '<p>' . __( '<strong>Parent</strong> — You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' . 407 407 '<p>' . __( '<strong>Template</strong> — Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.' ) . '</p>' . … … 472 472 <?php 473 473 } 474 if ( 'draft' != get_post_status( $post ) ) {474 if ( 'draft' !== get_post_status( $post ) ) { 475 475 wp_original_referer_field( true, 'previous' ); 476 476 } … … 496 496 497 497 <div id="poststuff"> 498 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">498 <div id="post-body" class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>"> 499 499 <div id="post-body-content"> 500 500 … … 536 536 537 537 if ( ! empty( $shortlink ) && $shortlink !== $permalink && home_url( '?page_id=' . $post->ID ) !== $permalink ) { 538 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>'; 538 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" />' . 539 '<button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . 540 __( 'Get Shortlink' ) . 541 '</button>'; 539 542 } 540 543 } 541 544 542 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { 543 $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status; 545 if ( $post_type_object->public 546 && ! ( 'pending' === get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) 547 ) { 548 $has_sample_permalink = $sample_permalink_html && 'auto-draft' !== $post->post_status; 544 549 ?> 545 550 <div id="edit-slug-box" class="hide-if-no-js"> … … 609 614 <span class="autosave-message"> </span> 610 615 <?php 611 if ( 'auto-draft' != $post->post_status ) {616 if ( 'auto-draft' !== $post->post_status ) { 612 617 echo '<span id="last-edit">'; 613 618 $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ); … … 643 648 <?php 644 649 645 if ( 'page' == $post_type ) {650 if ( 'page' === $post_type ) { 646 651 /** 647 652 * Fires before meta boxes with 'side' context are output for the 'page' post type. … … 677 682 do_meta_boxes( null, 'normal', $post ); 678 683 679 if ( 'page' == $post_type ) {684 if ( 'page' === $post_type ) { 680 685 /** 681 686 * Fires after 'normal' context meta boxes have been output for the 'page' post type. -
trunk/src/wp-admin/edit-form-comment.php
r47410 r47785 119 119 </fieldset> 120 120 </div><!-- .misc-pub-section --> 121 121 122 122 <div class="misc-pub-section curtime misc-pub-curtime"> 123 123 <?php -
trunk/src/wp-admin/edit-link-form.php
r47410 r47785 109 109 <div id="poststuff"> 110 110 111 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">111 <div id="post-body" class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>"> 112 112 <div id="post-body-content"> 113 113 <div id="namediv" class="stuffbox"> -
trunk/src/wp-admin/edit-tag-form.php
r47198 r47785 13 13 14 14 // Back compat hooks. 15 if ( 'category' == $taxonomy ) {15 if ( 'category' === $taxonomy ) { 16 16 /** 17 17 * Fires before the Edit Category form. … … 23 23 */ 24 24 do_action_deprecated( 'edit_category_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' ); 25 } elseif ( 'link_category' == $taxonomy ) {25 } elseif ( 'link_category' === $taxonomy ) { 26 26 /** 27 27 * Fires before the Edit Link Category form. … … 178 178 wp_dropdown_categories( $dropdown_args ); 179 179 ?> 180 <?php if ( 'category' == $taxonomy ) : ?>180 <?php if ( 'category' === $taxonomy ) : ?> 181 181 <p class="description"><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p> 182 182 <?php else : ?> … … 193 193 <?php 194 194 // Back compat hooks. 195 if ( 'category' == $taxonomy ) {195 if ( 'category' === $taxonomy ) { 196 196 /** 197 197 * Fires after the Edit Category form fields are displayed. … … 203 203 */ 204 204 do_action_deprecated( 'edit_category_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' ); 205 } elseif ( 'link_category' == $taxonomy ) {205 } elseif ( 'link_category' === $taxonomy ) { 206 206 /** 207 207 * Fires after the Edit Link Category form fields are displayed. … … 240 240 <?php 241 241 // Back compat hooks. 242 if ( 'category' == $taxonomy ) {242 if ( 'category' === $taxonomy ) { 243 243 /** This action is documented in wp-admin/edit-tags.php */ 244 244 do_action_deprecated( 'edit_category_form', array( $tag ), '3.0.0', '{$taxonomy}_add_form' ); 245 } elseif ( 'link_category' == $taxonomy ) {245 } elseif ( 'link_category' === $taxonomy ) { 246 246 /** This action is documented in wp-admin/edit-tags.php */ 247 247 do_action_deprecated( 'edit_link_category_form', array( $tag ), '3.0.0', '{$taxonomy}_add_form' ); -
trunk/src/wp-admin/edit.php
r47550 r47785 333 333 /* translators: %s: Number of posts. */ 334 334 'updated' => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ), 335 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :335 'locked' => ( 1 === $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) : 336 336 /* translators: %s: Number of posts. */ 337 337 _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ), … … 346 346 /* translators: %s: Number of pages. */ 347 347 'updated' => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ), 348 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :348 'locked' => ( 1 === $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) : 349 349 /* translators: %s: Number of pages. */ 350 350 _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ), … … 359 359 /* translators: %s: Number of blocks. */ 360 360 'updated' => _n( '%s block updated.', '%s blocks updated.', $bulk_counts['updated'] ), 361 'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 block not updated, somebody is editing it.' ) :361 'locked' => ( 1 === $bulk_counts['locked'] ) ? __( '1 block not updated, somebody is editing it.' ) : 362 362 /* translators: %s: Number of blocks. */ 363 363 _n( '%s block not updated, somebody is editing it.', '%s blocks not updated, somebody is editing them.', $bulk_counts['locked'] ), -
trunk/src/wp-admin/export.php
r47272 r47785 63 63 $args = array(); 64 64 65 if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {65 if ( ! isset( $_GET['content'] ) || 'all' === $_GET['content'] ) { 66 66 $args['content'] = 'all'; 67 } elseif ( 'posts' == $_GET['content'] ) {67 } elseif ( 'posts' === $_GET['content'] ) { 68 68 $args['content'] = 'post'; 69 69 … … 84 84 $args['status'] = $_GET['post_status']; 85 85 } 86 } elseif ( 'pages' == $_GET['content'] ) {86 } elseif ( 'pages' === $_GET['content'] ) { 87 87 $args['content'] = 'page'; 88 88 … … 99 99 $args['status'] = $_GET['page_status']; 100 100 } 101 } elseif ( 'attachment' == $_GET['content'] ) {101 } elseif ( 'attachment' === $_GET['content'] ) { 102 102 $args['content'] = 'attachment'; 103 103 … … 145 145 WHERE post_type = %s AND post_status != 'auto-draft' 146 146 ORDER BY post_date DESC 147 ",147 ", 148 148 $post_type 149 149 ) … … 151 151 152 152 $month_count = count( $months ); 153 if ( ! $month_count || ( 1 == $month_count && 0 ==$months[0]->month ) ) {153 if ( ! $month_count || ( 1 === $month_count && 0 === (int) $months[0]->month ) ) { 154 154 return; 155 155 } 156 156 157 157 foreach ( $months as $date ) { 158 if ( 0 == $date->year ) {158 if ( 0 === (int) $date->year ) { 159 159 continue; 160 160 } -
trunk/src/wp-admin/import.php
r47198 r47785 43 43 if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) { 44 44 $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id']; 45 if ( $importer_id != $_GET['invalid'] ) { // Prevent redirect loops.45 if ( $importer_id !== $_GET['invalid'] ) { // Prevent redirect loops. 46 46 wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) ); 47 47 exit; -
trunk/src/wp-admin/includes/upgrade.php
r47597 r47785 2347 2347 $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) ); 2348 2348 2349 if ( $wpdb->get_var( $query ) == $table_name ) {2349 if ( $wpdb->get_var( $query ) === $table_name ) { 2350 2350 return true; 2351 2351 } … … 2355 2355 2356 2356 // We cannot directly tell that whether this succeeded! 2357 if ( $wpdb->get_var( $query ) == $table_name ) {2357 if ( $wpdb->get_var( $query ) === $table_name ) { 2358 2358 return true; 2359 2359 } 2360 2360 2361 return false; 2361 2362 } … … 2374 2375 function drop_index( $table, $index ) { 2375 2376 global $wpdb; 2377 2376 2378 $wpdb->hide_errors(); 2379 2377 2380 $wpdb->query( "ALTER TABLE `$table` DROP INDEX `$index`" ); 2381 2378 2382 // Now we need to take out all the extra ones we may have created. 2379 2383 for ( $i = 0; $i < 25; $i++ ) { 2380 2384 $wpdb->query( "ALTER TABLE `$table` DROP INDEX `{$index}_$i`" ); 2381 2385 } 2386 2382 2387 $wpdb->show_errors(); 2388 2383 2389 return true; 2384 2390 } … … 2397 2403 function add_clean_index( $table, $index ) { 2398 2404 global $wpdb; 2405 2399 2406 drop_index( $table, $index ); 2400 2407 $wpdb->query( "ALTER TABLE `$table` ADD INDEX ( `$index` )" ); 2408 2401 2409 return true; 2402 2410 } … … 2416 2424 function maybe_add_column( $table_name, $column_name, $create_ddl ) { 2417 2425 global $wpdb; 2426 2418 2427 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 2419 if ( $column == $column_name ) {2428 if ( $column === $column_name ) { 2420 2429 return true; 2421 2430 } … … 2427 2436 // We cannot directly tell that whether this succeeded! 2428 2437 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 2429 if ( $column == $column_name ) {2438 if ( $column === $column_name ) { 2430 2439 return true; 2431 2440 } 2432 2441 } 2442 2433 2443 return false; 2434 2444 } -
trunk/src/wp-admin/install-helper.php
r47219 r47785 52 52 function maybe_create_table( $table_name, $create_ddl ) { 53 53 global $wpdb; 54 54 55 foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { 55 if ( $table == $table_name ) { 56 return true; 57 } 58 } 56 if ( $table === $table_name ) { 57 return true; 58 } 59 } 60 59 61 // Didn't find it, so try to create it. 60 62 $wpdb->query( $create_ddl ); … … 62 64 // We cannot directly tell that whether this succeeded! 63 65 foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { 64 if ( $table == $table_name ) { 65 return true; 66 } 67 } 66 if ( $table === $table_name ) { 67 return true; 68 } 69 } 70 68 71 return false; 69 72 } … … 85 88 function maybe_add_column( $table_name, $column_name, $create_ddl ) { 86 89 global $wpdb; 90 87 91 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 88 89 if ( $column == $column_name ) { 92 if ( $column === $column_name ) { 90 93 return true; 91 94 } … … 97 100 // We cannot directly tell that whether this succeeded! 98 101 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 99 if ( $column == $column_name ) { 100 return true; 101 } 102 } 102 if ( $column === $column_name ) { 103 return true; 104 } 105 } 106 103 107 return false; 104 108 } … … 119 123 function maybe_drop_column( $table_name, $column_name, $drop_ddl ) { 120 124 global $wpdb; 125 121 126 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 122 if ( $column == $column_name ) {127 if ( $column === $column_name ) { 123 128 124 129 // Found it, so try to drop it. … … 127 132 // We cannot directly tell that whether this succeeded! 128 133 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 129 if ( $column == $column_name ) {134 if ( $column === $column_name ) { 130 135 return false; 131 136 } … … 133 138 } 134 139 } 140 135 141 // Else didn't find it. 136 142 return true; … … 168 174 function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null ) { 169 175 global $wpdb; 176 170 177 $diffs = 0; 171 178 $results = $wpdb->get_results( "DESC $table_name" ); … … 173 180 foreach ( $results as $row ) { 174 181 175 if ( $row->Field == $col_name ) {182 if ( $row->Field === $col_name ) { 176 183 177 184 // Got our column, check the params. 178 if ( ( null != $col_type ) && ( $row->Type != $col_type ) ) { 179 ++$diffs; 180 } 181 if ( ( null != $is_null ) && ( $row->Null != $is_null ) ) { 182 ++$diffs; 183 } 184 if ( ( null != $key ) && ( $row->Key != $key ) ) { 185 ++$diffs; 186 } 187 if ( ( null != $default ) && ( $row->Default != $default ) ) { 188 ++$diffs; 189 } 190 if ( ( null != $extra ) && ( $row->Extra != $extra ) ) { 191 ++$diffs; 192 } 185 if ( ( null !== $col_type ) && ( $row->Type !== $col_type ) ) { 186 ++$diffs; 187 } 188 if ( ( null !== $is_null ) && ( $row->Null !== $is_null ) ) { 189 ++$diffs; 190 } 191 if ( ( null !== $key ) && ( $row->Key !== $key ) ) { 192 ++$diffs; 193 } 194 if ( ( null !== $default ) && ( $row->Default !== $default ) ) { 195 ++$diffs; 196 } 197 if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) { 198 ++$diffs; 199 } 200 193 201 if ( $diffs > 0 ) { 194 202 return false; 195 203 } 204 196 205 return true; 197 206 } // End if found our column. 198 207 } 208 199 209 return false; 200 210 } -
trunk/src/wp-admin/install.php
r47746 r47785 92 92 global $wpdb; 93 93 94 $sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->users ) ); 95 $user_table = ( $wpdb->get_var( $sql ) != null ); 94 $user_table = ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->users ) ) ) !== null ); 96 95 97 96 // Ensure that sites appear in search engines by default. … … 370 369 display_setup_form( __( 'Please provide a valid username.' ) ); 371 370 $error = true; 372 } elseif ( sanitize_user( $user_name, true ) != $user_name ) {371 } elseif ( sanitize_user( $user_name, true ) !== $user_name ) { 373 372 display_setup_form( __( 'The username you provided has invalid characters.' ) ); 374 373 $error = true; 375 } elseif ( $admin_password != $admin_password_check ) {374 } elseif ( $admin_password !== $admin_password_check ) { 376 375 // TODO: Poka-yoke. 377 376 display_setup_form( __( 'Your passwords do not match. Please try again.' ) ); -
trunk/src/wp-admin/link-manager.php
r47198 r47785 24 24 $bulklinks = (array) $_REQUEST['linkcheck']; 25 25 26 if ( 'delete' == $doaction ) {26 if ( 'delete' === $doaction ) { 27 27 foreach ( $bulklinks as $link_id ) { 28 28 $link_id = (int) $link_id; -
trunk/src/wp-admin/link-parse-opml.php
r47397 r47785 28 28 * @global array $feeds 29 29 * 30 * @param resource $parser XML Parser resource.31 * @param string $tagName XML element name.32 * @param array $attrsXML element attributes.30 * @param resource $parser XML Parser resource. 31 * @param string $tag_name XML element name. 32 * @param array $attrs XML element attributes. 33 33 */ 34 function startElement( $parser, $tag Name, $attrs ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid34 function startElement( $parser, $tag_name, $attrs ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid 35 35 global $names, $urls, $targets, $descriptions, $feeds; 36 36 37 if ( 'OUTLINE' === $tag Name ) {37 if ( 'OUTLINE' === $tag_name ) { 38 38 $name = ''; 39 39 if ( isset( $attrs['TEXT'] ) ) { … … 66 66 * @access private 67 67 * 68 * @param resource $parser XML Parser resource.69 * @param string $tagName XML tag name.68 * @param resource $parser XML Parser resource. 69 * @param string $tag_name XML tag name. 70 70 */ 71 function endElement( $parser, $tag Name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid71 function endElement( $parser, $tag_name ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid 72 72 // Nothing to do. 73 73 } -
trunk/src/wp-admin/link.php
r47198 r47785 36 36 37 37 // For each link id (in $linkcheck[]) change category to selected value. 38 if ( count( $linkcheck ) == 0 ) {38 if ( count( $linkcheck ) === 0 ) { 39 39 wp_redirect( $this_file ); 40 40 exit; … … 57 57 58 58 // For each link id (in $linkcheck[]) change category to selected value. 59 if ( count( $linkcheck ) == 0 ) {59 if ( count( $linkcheck ) === 0 ) { 60 60 wp_redirect( $this_file ); 61 61 exit; -
trunk/src/wp-admin/load-styles.php
r47550 r47785 38 38 } 39 39 40 $rtl = ( isset( $_GET['dir'] ) && 'rtl' == $_GET['dir'] );40 $rtl = ( isset( $_GET['dir'] ) && 'rtl' === $_GET['dir'] ); 41 41 $expires_offset = 31536000; // 1 year. 42 42 $out = ''; -
trunk/src/wp-admin/media-upload.php
r47218 r47785 30 30 31 31 // IDs should be integers. 32 $ID = isset( $ID ) ? (int) $ID : 0; 32 $ID = isset( $ID ) ? (int) $ID : 0; // phpcs:ignore WordPress.NamingConventions.ValidVariableName 33 33 $post_id = isset( $post_id ) ? (int) $post_id : 0; 34 34 35 35 // Require an ID for the edit screen. 36 if ( isset( $action ) && 'edit' == $action && ! $ID ) {36 if ( isset( $action ) && 'edit' === $action && ! $ID ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName 37 37 wp_die( 38 38 '<h1>' . __( 'Something went wrong.' ) . '</h1>' . … … 82 82 83 83 // Let the action code decide how to handle the request. 84 if ( 'type' == $tab || 'type_url'== $tab || ! array_key_exists( $tab, media_upload_tabs() ) ) {84 if ( 'type' === $tab || 'type_url' === $tab || ! array_key_exists( $tab, media_upload_tabs() ) ) { 85 85 /** 86 86 * Fires inside specific upload-type views in the legacy (pre-3.5.0) -
trunk/src/wp-admin/media.php
r47218 r47785 30 30 $referer = wp_get_original_referer(); 31 31 if ( $referer ) { 32 if ( false !== strpos( $referer, 'upload.php' ) || ( url_to_postid( $referer ) == $attachment_id ) ) {32 if ( false !== strpos( $referer, 'upload.php' ) || ( url_to_postid( $referer ) === $attachment_id ) ) { 33 33 $location = $referer; 34 34 } … … 70 70 wp_die( __( 'You attempted to edit an item that isn’t an attachment. Please go back and try again.' ) ); 71 71 } 72 if ( 'trash' == $att->post_status ) {72 if ( 'trash' === $att->post_status ) { 73 73 wp_die( __( 'You can’t edit this attachment because it is in the Trash. Please move it out of the Trash and try again.' ) ); 74 74 } -
trunk/src/wp-admin/menu-header.php
r47122 r47785 89 89 } 90 90 91 if ( ( $parent_file && $item[2] == $parent_file ) || ( empty( $typenow ) && $self== $item[2] ) ) {91 if ( ( $parent_file && $item[2] === $parent_file ) || ( empty( $typenow ) && $self === $item[2] ) ) { 92 92 if ( ! empty( $submenu_items ) ) { 93 93 $class[] = 'wp-has-current-submenu wp-menu-open'; … … 155 155 $menu_file = $submenu_items[0][2]; 156 156 $pos = strpos( $menu_file, '?' ); 157 157 158 if ( false !== $pos ) { 158 159 $menu_file = substr( $menu_file, 0, $pos ); 159 160 } 160 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { 161 162 if ( ! empty( $menu_hook ) 163 || ( ( 'index.php' !== $submenu_items[0][2] ) 164 && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) 165 && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) 166 ) { 161 167 $admin_is_parent = true; 162 168 echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>"; … … 168 174 $menu_file = $item[2]; 169 175 $pos = strpos( $menu_file, '?' ); 176 170 177 if ( false !== $pos ) { 171 178 $menu_file = substr( $menu_file, 0, $pos ); 172 179 } 173 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { 180 181 if ( ! empty( $menu_hook ) 182 || ( ( 'index.php' !== $item[2] ) 183 && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) 184 && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) 185 ) { 174 186 $admin_is_parent = true; 175 187 echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; … … 193 205 $class = array(); 194 206 $aria_attributes = ''; 207 195 208 if ( $first ) { 196 209 $class[] = 'wp-first-item'; … … 199 212 200 213 $menu_file = $item[2]; 201 202 $pos = strpos( $menu_file, '?' ); 214 $pos = strpos( $menu_file, '?' ); 215 203 216 if ( false !== $pos ) { 204 217 $menu_file = substr( $menu_file, 0, $pos ); … … 209 222 210 223 if ( isset( $submenu_file ) ) { 211 if ( $submenu_file == $sub_item[2] ) {224 if ( $submenu_file === $sub_item[2] ) { 212 225 $class[] = 'current'; 213 226 $aria_attributes .= ' aria-current="page"'; … … 216 229 // This allows plugin pages with the same hook to exist under different parents. 217 230 } elseif ( 218 ( ! isset( $plugin_page ) && $self == $sub_item[2] ) || 219 ( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists( $menu_file ) === false ) ) 231 ( ! isset( $plugin_page ) && $self === $sub_item[2] ) 232 || ( isset( $plugin_page ) && $plugin_page === $sub_item[2] 233 && ( $item[2] === $self_type || $item[2] === $self || file_exists( $menu_file ) === false ) ) 220 234 ) { 221 235 $class[] = 'current'; … … 238 252 $title = wptexturize( $sub_item[0] ); 239 253 240 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $sub_item[2] ) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) ) { 254 if ( ! empty( $menu_hook ) 255 || ( ( 'index.php' !== $sub_item[2] ) 256 && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) 257 && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) 258 ) { 241 259 // If admin.php is the current page or if the parent exists as a file in the plugins or admin directory. 242 260 if ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! is_dir( WP_PLUGIN_DIR . "/{$item[2]}" ) ) || file_exists( $menu_file ) ) { -
trunk/src/wp-admin/ms-delete-site.php
r47218 r47785 18 18 } 19 19 20 if ( isset( $_GET['h'] ) && '' != $_GET['h'] && false != get_option( 'delete_blog_hash' ) ) {20 if ( isset( $_GET['h'] ) && '' !== $_GET['h'] && false !== get_option( 'delete_blog_hash' ) ) { 21 21 if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) { 22 22 wpmu_delete_blog( get_current_blog_id() ); … … 43 43 echo '<h1>' . esc_html( $title ) . '</h1>'; 44 44 45 if ( isset( $_POST['action'] ) && 'deleteblog' == $_POST['action'] && isset( $_POST['confirmdelete'] ) && '1'== $_POST['confirmdelete'] ) {45 if ( isset( $_POST['action'] ) && 'deleteblog' === $_POST['action'] && isset( $_POST['confirmdelete'] ) && '1' === $_POST['confirmdelete'] ) { 46 46 check_admin_referer( 'delete-blog' ); 47 47 -
trunk/src/wp-admin/my-sites.php
r47550 r47785 23 23 24 24 $updated = false; 25 if ( 'updateblogsettings' == $action && isset( $_POST['primary_blog'] ) ) {25 if ( 'updateblogsettings' === $action && isset( $_POST['primary_blog'] ) ) { 26 26 check_admin_referer( 'update-my-sites' ); 27 27 … … 108 108 */ 109 109 $settings_html = apply_filters( 'myblogs_options', '', 'global' ); 110 if ( '' != $settings_html ) { 110 111 if ( $settings_html ) { 111 112 echo '<h3>' . __( 'Global Settings' ) . '</h3>'; 112 113 echo $settings_html; 113 114 } 115 114 116 reset( $blogs ); 115 117 … … 135 137 */ 136 138 $actions = apply_filters( 'myblogs_blog_actions', $actions, $user_blog ); 139 137 140 echo "<p class='my-sites-actions'>" . $actions . '</p>'; 138 141 139 142 /** This filter is documented in wp-admin/my-sites.php */ 140 143 echo apply_filters( 'myblogs_options', '', $user_blog ); 144 141 145 echo '</li>'; 142 146
Note: See TracChangeset
for help on using the changeset viewer.