upgrade_422()

Execute changes made in WordPress 4.2.2.


Source Source

File: wp-admin/includes/upgrade.php

				$wpdb->insert( $wpdb->terms, compact( 'name', 'slug', 'term_group' ) );
				$term_id = (int) $wpdb->insert_id;
			}

			$link_cat_id_map[ $cat_id ] = $term_id;
			$default_link_cat           = $term_id;

			$wpdb->insert(
				$wpdb->term_taxonomy,
				array(
					'term_id'     => $term_id,
					'taxonomy'    => 'link_category',
					'description' => '',
					'parent'      => 0,
					'count'       => 0,
				)
			);
			$tt_ids[ $term_id ] = (int) $wpdb->insert_id;
		}

		// Associate links to categories.
		$links = $wpdb->get_results( "SELECT link_id, link_category FROM $wpdb->links" );
		if ( ! empty( $links ) ) {
			foreach ( $links as $link ) {
				if ( 0 == $link->link_category ) {
					continue;
				}
				if ( ! isset( $link_cat_id_map[ $link->link_category ] ) ) {
					continue;
				}
				$term_id = $link_cat_id_map[ $link->link_category ];
				$tt_id   = $tt_ids[ $term_id ];
				if ( empty( $tt_id ) ) {
					continue;
				}

				$wpdb->insert(
					$wpdb->term_relationships,
					array(
						'object_id'        => $link->link_id,
						'term_taxonomy_id' => $tt_id,
					)

Top ↑

Changelog Changelog

Changelog
Version Description
4.2.2 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.