classes/PodsTermSplitting.php
private function update_relationships_to_term() {

		// Loop through all Pods
		$all_pods = pods_api()->load_pods();

		if ( ! is_array( $all_pods ) ) {
			return;
		}

		foreach ( $all_pods as $this_pod_id => $this_pod ) {

			// Loop through all fields in this Pod
			foreach ( $this_pod['fields'] as $this_field_name => $this_field ) {

				// Ignore everything except relationship fields to this taxonomy
				if ( 'pick' !== $this_field['type'] || 'taxonomy' !== $this_field['pick_object'] || $this->taxonomy != $this_field['pick_val'] ) {
					continue;
				}

				// Update the term ID in podsrel everywhere it is the value for this field
				$this->update_podsrel_related_term( $this_field['id'] );

				// Fix-up any special-case relationships that store term IDs in their own meta table and/or serialized
				switch ( $this_pod['type'] ) {

					case 'post_type':
						$this->update_postmeta( $this_pod['name'], $this_field_name );
						break;

					case 'comment':
						$this->update_commentmeta( $this_field_name );
						break;

					case 'user':
						$this->update_usermeta( $this_field_name );
						break;

					case 'settings':
						$this->update_setting_meta( $this_pod['name'], $this_field_name );
						break;
				}
			}//end foreach
		}//end foreach

	}
private function update_relationships_to_term() {

		// Loop through all Pods
		$all_pods = pods_api()->load_pods();

		if ( ! is_array( $all_pods ) ) {
			return;
		}

		foreach ( $all_pods as $this_pod_id => $this_pod ) {

			// Loop through all fields in this Pod
			foreach ( $this_pod['fields'] as $this_field_name => $this_field ) {

				// Ignore everything except relationship fields to this taxonomy
				if ( 'pick' !== $this_field['type'] || 'taxonomy' !== $this_field['pick_object'] || $this->taxonomy != $this_field['pick_val'] ) {
					continue;
				}

				// Update the term ID in podsrel everywhere it is the value for this field
				$this->update_podsrel_related_term( $this_field['id'] );

				// Fix-up any special-case relationships that store term IDs in their own meta table and/or serialized
				switch ( $this_pod['type'] ) {

					case 'post_type':
						$this->update_postmeta( $this_pod['name'], $this_field_name );
						break;

					case 'comment':
						$this->update_commentmeta( $this_field_name );
						break;

					case 'user':
						$this->update_usermeta( $this_field_name );
						break;

					case 'settings':
						$this->update_setting_meta( $this_pod['name'], $this_field_name );
						break;
				}
			}//end foreach
		}//end foreach

	}
private function update_relationships_to_term ( ) { // Loop through all Pods $ all_pods = pods_api ( ) -> load_pods ( ) ; if ( ! is_array ( $ all_pods ) ) { return ; } foreach ( $ all_pods as $ this_pod_id => $ this_pod ) { // Loop through all fields in this Pod foreach ( $ this_pod [ 'fields' ] as $ this_field_name => $ this_field ) { // Ignore everything except relationship fields to this taxonomy if ( 'pick' !== $ this_field [ 'type' ] || 'taxonomy' !== $ this_field [ 'pick_object' ] || $ this -> taxonomy != $ this_field [ 'pick_val' ] ) { continue ; } // Update the term ID in podsrel everywhere it is the value for this field $ this -> update_podsrel_related_term ( $ this_field [ 'id' ] ) ; // Fix-up any special-case relationships that store term IDs in their own meta table and/or serialized switch ( $ this_pod [ 'type' ] ) { case 'post_type' : $ this -> update_postmeta ( $ this_pod [ 'name' ] , $ this_field_name ) ; break ; case 'comment' : $ this -> update_commentmeta ( $ this_field_name ) ; break ; case 'user' : $ this -> update_usermeta ( $ this_field_name ) ; break ; case 'settings' : $ this -> update_setting_meta ( $ this_pod [ 'name' ] , $ this_field_name ) ; break ; } } //end foreach } //end foreach }
Track down all fields related to the target taxonomy and update stored term IDs as necessary
Track down all fields related to the target taxonomy and update stored term IDs as necessary