WordPress at a glance
function is not described

generate_postdata() WP 5.2.0

Generates post data.

No Hooks.

Return

Array/true/false. Elements of post, or false on failure.

Usage

generate_postdata( $post );
$post(WP_Post/object/int) (required)
WP_Post instance or Post ID/object.

Notes

  • Global. WP_Query. $wp_query WordPress Query object.

Changelog

Since 5.2.0 Introduced.

Code of generate_postdata() WP 5.5.1

<?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;
}