PUM_Abstract_Upgrade_Posts::pre_fetch()


Description Description


Source Source

File: classes/Abstract/Upgrade/Posts.php

	public function pre_fetch() {
		$total_to_migrate = $this->get_total_count();

		if ( ! $total_to_migrate ) {
			$posts = $this->get_posts( array(
				'fields'         => 'ids',
				'posts_per_page' => - 1,
			) );

			$posts = wp_parse_id_list( $posts );

			$total_to_migrate = count( $posts );

			if ( $this->prefetch_ids ) {
				$this->set_post_ids( $posts );
			}

			$this->set_total_count( $total_to_migrate );
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

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