Provider::hydrate_provisional_post_caches( array|object|null $results )

Hydrates the Provisional Post caches (post fields, custom fields) to allow calls to get_post( $provisional_post_id ) to return properly formed post objects.


Parameters

$results

(array|object|null) (Required) The query results.


Top ↑

Source

File: src/Events_Pro/Custom_Tables/V1/WP_Query/Provider.php

	public function hydrate_provisional_post_caches( $results ) {
		if (
			$this->noop
			|| ! (
				$results
				&& is_array( $results )
				&& array_filter( (array) $results, 'is_numeric' )
			)
		) {
			// Not a set of post IDs or an empty array: let's avoid building the Provisional Post instance.
			return $results;
		}

		return $this->container->make( Provisional_Post::class )->hydrate_caches( $results );
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.