Changeset 45583 for trunk/src/wp-admin/includes/upgrade.php
- Timestamp:
- 07/01/2019 12:50:14 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r45580 r45583 1261 1261 1262 1262 // Associate terms with the same slug in a term group and make slugs unique. 1263 if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) { 1263 $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ); 1264 if ( $exists ) { 1264 1265 $term_group = $exists[0]->term_group; 1265 1266 $id = $exists[0]->term_id; … … 1366 1367 1367 1368 // Associate terms with the same slug in a term group and make slugs unique. 1368 if ( $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ) ) { 1369 $exists = $wpdb->get_results( $wpdb->prepare( "SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug ) ); 1370 if ( $exists ) { 1369 1371 $term_group = $exists[0]->term_group; 1370 1372 $term_id = $exists[0]->term_id; … … 1824 1826 } 1825 1827 1826 if ( $wp_current_db_version < 22422 && $term = get_term_by( 'slug', 'post-format-standard', 'post_format' ) ) { 1827 wp_delete_term( $term->term_id, 'post_format' ); 1828 if ( $wp_current_db_version < 22422 ) { 1829 $term = get_term_by( 'slug', 'post-format-standard', 'post_format' ); 1830 if ( $term ) { 1831 wp_delete_term( $term->term_id, 'post_format' ); 1832 } 1828 1833 } 1829 1834 } … … 2431 2436 global $wpdb; 2432 2437 $all_options = new stdClass; 2433 if ( $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ) ) { 2438 $options = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ); 2439 if ( $options ) { 2434 2440 foreach ( $options as $option ) { 2435 2441 if ( 'siteurl' == $option->option_name || 'home' == $option->option_name || 'category_base' == $option->option_name ) { … … 2608 2614 2609 2615 // Clear the field and index arrays. 2610 $cfields = $indices = $indices_without_subparts = array(); 2616 $cfields = array(); 2617 $indices = array(); 2618 $indices_without_subparts = array(); 2611 2619 2612 2620 // Get all of the field names in the query from between the parentheses. … … 2683 2691 2684 2692 // Parse the columns. Multiple columns are separated by a comma. 2685 $index_columns = $index_columns_without_subparts = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) ); 2693 $index_columns = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) ); 2694 $index_columns_without_subparts = $index_columns; 2686 2695 2687 2696 // Normalize columns. … … 2853 2862 2854 2863 // Check if the index definition exists, ignoring subparts. 2855 if ( ! ( ( $aindex = array_search( $index_string, $indices_without_subparts ) ) === false ) ) { 2864 $aindex = array_search( $index_string, $indices_without_subparts ); 2865 if ( false !== $aindex ) { 2856 2866 // If the index already exists (even with different subparts), we don't need to create it. 2857 2867 unset( $indices_without_subparts[ $aindex ] );
Note: See TracChangeset
for help on using the changeset viewer.