generate_postdata( WP_Post|object|int $post )

Generates post data.


Description Description


Parameters Parameters

$post

(WP_Post|object|int) (Required) WP_Post instance or Post ID/object.


Top ↑

Return Return

(array|bool) Elements of post, or false on failure.


Top ↑

Source Source

File: wp-includes/query.php

function generate_postdata( $post ) {
	global $wp_query;

	if ( ! empty( $wp_query ) && $wp_query instanceof WP_Query ) {
		return $wp_query->generate_postdata( $post );
	}

	return false;
}

Top ↑

Changelog Changelog

Changelog
Version Description
5.2.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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