wpseek.com
A WordPress-centric search engine for devs and theme authors



generate_postdata › WordPress Function

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|false) 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;
}