Changeset 47808 for trunk/src/wp-admin/includes/upgrade.php
- Timestamp:
- 05/16/2020 06:40:52 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r47786 r47808 863 863 if ( $posts ) { 864 864 foreach ( $posts as $post ) { 865 if ( '' == $post->post_name ) {865 if ( '' === $post->post_name ) { 866 866 $newtitle = sanitize_title( $post->post_title ); 867 867 $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_name = %s WHERE ID = %d", $newtitle, $post->ID ) ); … … 872 872 $categories = $wpdb->get_results( "SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories" ); 873 873 foreach ( $categories as $category ) { 874 if ( '' == $category->category_nicename ) {874 if ( '' === $category->category_nicename ) { 875 875 $newtitle = sanitize_title( $category->cat_name ); 876 876 $wpdb->update( $wpdb->categories, array( 'category_nicename' => $newtitle ), array( 'cat_ID' => $category->cat_ID ) ); … … 948 948 $users = $wpdb->get_results( "SELECT ID, user_nickname, user_nicename FROM $wpdb->users" ); 949 949 foreach ( $users as $user ) { 950 if ( '' == $user->user_nicename ) {950 if ( '' === $user->user_nicename ) { 951 951 $newname = sanitize_title( $user->user_nickname ); 952 952 $wpdb->update( $wpdb->users, array( 'user_nicename' => $newname ), array( 'ID' => $user->ID ) ); … … 983 983 * <michel_v> I just slapped myself silly for not thinking about it earlier. 984 984 */ 985 $got_gmt_fields = ! ( $wpdb->get_var( "SELECT MAX(post_date_gmt) FROM $wpdb->posts" ) == '0000-00-00 00:00:00');985 $got_gmt_fields = ( '0000-00-00 00:00:00' !== $wpdb->get_var( "SELECT MAX(post_date_gmt) FROM $wpdb->posts" ) ); 986 986 987 987 if ( ! $got_gmt_fields ) { … … 1227 1227 $type = 'post'; 1228 1228 1229 if ( 'static' == $status ) {1229 if ( 'static' === $status ) { 1230 1230 $status = 'publish'; 1231 1231 $type = 'page'; 1232 } elseif ( 'attachment' == $status ) {1232 } elseif ( 'attachment' === $status ) { 1233 1233 $status = 'inherit'; 1234 1234 $type = 'attachment'; … … 1358 1358 $term_id = (int) $post->category_id; 1359 1359 $taxonomy = 'category'; 1360 if ( ! empty( $post->rel_type ) && 'tag' == $post->rel_type ) {1360 if ( ! empty( $post->rel_type ) && 'tag' === $post->rel_type ) { 1361 1361 $taxonomy = 'tag'; 1362 1362 } … … 1476 1476 $terms = $wpdb->get_results( "SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy" ); 1477 1477 foreach ( (array) $terms as $term ) { 1478 if ( ( 'post_tag' == $term->taxonomy ) || ( 'category' == $term->taxonomy )) {1478 if ( 'post_tag' === $term->taxonomy || 'category' === $term->taxonomy ) { 1479 1479 $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term->term_taxonomy_id ) ); 1480 1480 } else { … … 1816 1816 1817 1817 if ( $wp_current_db_version < 20080 ) { 1818 if ( 'yes' == $wpdb->get_var( "SELECT autoload FROM $wpdb->options WHERE option_name = 'uninstall_plugins'" ) ) {1818 if ( 'yes' === $wpdb->get_var( "SELECT autoload FROM $wpdb->options WHERE option_name = 'uninstall_plugins'" ) ) { 1819 1819 $uninstall_plugins = get_option( 'uninstall_plugins' ); 1820 1820 delete_option( 'uninstall_plugins' ); … … 2292 2292 $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" ); 2293 2293 foreach ( $indexes as $index ) { 2294 if ( 'domain_path' == $index->Key_name && 'domain'== $index->Column_name && 140 != $index->Sub_part ) {2294 if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && 140 != $index->Sub_part ) { 2295 2295 $upgrade = true; 2296 2296 break; … … 2502 2502 if ( $options ) { 2503 2503 foreach ( $options as $option ) { 2504 if ( 'siteurl' == $option->option_name || 'home' == $option->option_name || 'category_base'== $option->option_name ) {2504 if ( 'siteurl' === $option->option_name || 'home' === $option->option_name || 'category_base' === $option->option_name ) { 2505 2505 $option->option_value = untrailingslashit( $option->option_value ); 2506 2506 } … … 2536 2536 $option = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting ) ); 2537 2537 2538 if ( 'home' === $setting && '' == $option ) {2538 if ( 'home' === $setting && '' === $option ) { 2539 2539 return __get_option( 'siteurl' ); 2540 2540 } 2541 2541 2542 if ( 'siteurl' === $setting || 'home' === $setting || 'category_base' === $setting || 'tag_base' === $setting) {2542 if ( in_array( $setting, array( 'siteurl', 'home', 'category_base', 'tag_base' ), true ) ) { 2543 2543 $option = untrailingslashit( $option ); 2544 2544 } … … 2916 2916 // For each column in the index. 2917 2917 foreach ( $index_data['columns'] as $column_data ) { 2918 if ( '' != $index_columns ) {2918 if ( '' !== $index_columns ) { 2919 2919 $index_columns .= ','; 2920 2920 } … … 3271 3271 3272 3272 foreach ( (array) $plugins as $plugin ) { 3273 if ( basename( $plugin ) == 'widgets.php') {3273 if ( 'widgets.php' === basename( $plugin ) ) { 3274 3274 array_splice( $plugins, array_search( $plugin, $plugins, true ), 1 ); 3275 3275 update_option( 'active_plugins', $plugins );
Note: See TracChangeset
for help on using the changeset viewer.