A WordPress-centric search engine for devs and theme authors



generate_postdata ›

Since5.2.0
Deprecatedn/a
generate_postdata ( $post )
Parameters:
  • (WP_Post|object|int) $post WP_Post instance or Post ID/object.
    Required: Yes
Returns:
  • (array|bool) Elements of post, or false on failure.
Defined at:
Codex:

Generates post data.



Source

function generate_postdata( $post ) {
	global $wp_query;

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

	return false;
}