components/Migrate-CPTUI/Migrate-CPTUI.php
public function ajax_migrate( $params ) {

		$post_types = (array) $this->post_types;
		$taxonomies = (array) $this->taxonomies;

		$migrate_post_types = array();

		if ( isset( $params->post_type ) && ! empty( $params->post_type ) ) {
			foreach ( $params->post_type as $post_type => $checked ) {
				if ( true === (boolean) $checked ) {
					$migrate_post_types[] = $post_type;
				}
			}
		}

		$migrate_taxonomies = array();

		if ( isset( $params->taxonomy ) && ! empty( $params->taxonomy ) ) {
			foreach ( $params->taxonomy as $taxonomy => $checked ) {
				if ( true === (boolean) $checked ) {
					$migrate_taxonomies[] = $taxonomy;
				}
			}
		}

		foreach ( $post_types as $k => $post_type ) {
			if ( ! in_array( pods_var( 'name', $post_type ), $migrate_post_types, true ) ) {
				continue;
			}

			$id = $this->migrate_post_type( $post_type );

			if ( 0 < $id ) {
				unset( $post_types[ $k ] );
			}
		}

		foreach ( $taxonomies as $k => $taxonomy ) {
			if ( ! in_array( pods_var( 'name', $taxonomy ), $migrate_taxonomies, true ) ) {
				continue;
			}

			$id = $this->migrate_taxonomy( $taxonomy );

			if ( 0 < $id ) {
				unset( $taxonomies[ $k ] );
			}
		}

		if ( 1 == pods_var( 'cleanup', $params, 0 ) ) {
			if ( ! empty( $post_types ) ) {
				if ( ! is_null( $this->post_option_name ) ) {
					update_option( $this->post_option_name, $post_types );
				}
			} else {
				if ( ! is_null( $this->post_option_name ) ) {
					delete_option( $this->post_option_name );
				}
			}

			if ( ! empty( $taxonomies ) ) {
				if ( ! is_null( $this->taxonomy_option_name ) ) {
					update_option( $this->taxonomy_option_name, $taxonomies );
				}
			} else {
				if ( ! is_null( $this->taxonomy_option_name ) ) {
					delete_option( $this->taxonomy_option_name );
				}
			}
		}//end if
	}
public function ajax_migrate( $params ) {

		$post_types = (array) $this->post_types;
		$taxonomies = (array) $this->taxonomies;

		$migrate_post_types = array();

		if ( isset( $params->post_type ) && ! empty( $params->post_type ) ) {
			foreach ( $params->post_type as $post_type => $checked ) {
				if ( true === (boolean) $checked ) {
					$migrate_post_types[] = $post_type;
				}
			}
		}

		$migrate_taxonomies = array();

		if ( isset( $params->taxonomy ) && ! empty( $params->taxonomy ) ) {
			foreach ( $params->taxonomy as $taxonomy => $checked ) {
				if ( true === (boolean) $checked ) {
					$migrate_taxonomies[] = $taxonomy;
				}
			}
		}

		foreach ( $post_types as $k => $post_type ) {
			if ( ! in_array( pods_var( 'name', $post_type ), $migrate_post_types, true ) ) {
				continue;
			}

			$id = $this->migrate_post_type( $post_type );

			if ( 0 < $id ) {
				unset( $post_types[ $k ] );
			}
		}

		foreach ( $taxonomies as $k => $taxonomy ) {
			if ( ! in_array( pods_var( 'name', $taxonomy ), $migrate_taxonomies, true ) ) {
				continue;
			}

			$id = $this->migrate_taxonomy( $taxonomy );

			if ( 0 < $id ) {
				unset( $taxonomies[ $k ] );
			}
		}

		if ( 1 == pods_var( 'cleanup', $params, 0 ) ) {
			if ( ! empty( $post_types ) ) {
				if ( ! is_null( $this->post_option_name ) ) {
					update_option( $this->post_option_name, $post_types );
				}
			} else {
				if ( ! is_null( $this->post_option_name ) ) {
					delete_option( $this->post_option_name );
				}
			}

			if ( ! empty( $taxonomies ) ) {
				if ( ! is_null( $this->taxonomy_option_name ) ) {
					update_option( $this->taxonomy_option_name, $taxonomies );
				}
			} else {
				if ( ! is_null( $this->taxonomy_option_name ) ) {
					delete_option( $this->taxonomy_option_name );
				}
			}
		}//end if
	}
public function ajax_migrate ( $ params ) { $ post_types = ( array ) $ this -> post_types ; $ taxonomies = ( array ) $ this -> taxonomies ; $ migrate_post_types = array ( ) ; if ( isset ( $ params -> post_type ) && ! empty ( $ params -> post_type ) ) { foreach ( $ params -> post_type as $ post_type => $ checked ) { if ( true === ( boolean ) $ checked ) { $ migrate_post_types [ ] = $ post_type ; } } } $ migrate_taxonomies = array ( ) ; if ( isset ( $ params -> taxonomy ) && ! empty ( $ params -> taxonomy ) ) { foreach ( $ params -> taxonomy as $ taxonomy => $ checked ) { if ( true === ( boolean ) $ checked ) { $ migrate_taxonomies [ ] = $ taxonomy ; } } } foreach ( $ post_types as $ k => $ post_type ) { if ( ! in_array ( pods_var ( 'name' , $ post_type ) , $ migrate_post_types , true ) ) { continue ; } $ id = $ this -> migrate_post_type ( $ post_type ) ; if ( 0 < $ id ) { unset ( $ post_types [ $ k ] ) ; } } foreach ( $ taxonomies as $ k => $ taxonomy ) { if ( ! in_array ( pods_var ( 'name' , $ taxonomy ) , $ migrate_taxonomies , true ) ) { continue ; } $ id = $ this -> migrate_taxonomy ( $ taxonomy ) ; if ( 0 < $ id ) { unset ( $ taxonomies [ $ k ] ) ; } } if ( 1 == pods_var ( 'cleanup' , $ params , 0 ) ) { if ( ! empty ( $ post_types ) ) { if ( ! is_null ( $ this -> post_option_name ) ) { update_option ( $ this -> post_option_name , $ post_types ) ; } } else { if ( ! is_null ( $ this -> post_option_name ) ) { delete_option ( $ this -> post_option_name ) ; } } if ( ! empty ( $ taxonomies ) ) { if ( ! is_null ( $ this -> taxonomy_option_name ) ) { update_option ( $ this -> taxonomy_option_name , $ taxonomies ) ; } } else { if ( ! is_null ( $ this -> taxonomy_option_name ) ) { delete_option ( $ this -> taxonomy_option_name ) ; } } } //end if }
Handle the Migration AJAX

@param $params
Handle the Migration AJAX