On this page
generate_postdata( WP_Post|object|int $post ): array|false
Generates post data.
Parameters
Return
array|false Elements of post, or false on failure.
Source
File: wp-includes/query.php. View all references
function generate_postdata( $post ) {
global $wp_query;
if ( ! empty( $wp_query ) && $wp_query instanceof WP_Query ) {
return $wp_query->generate_postdata( $post );
}
return false;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Query::generate_postdata() wp-includes/class-wp-query.php | Generate post data. |
Used By
| Used By | Description |
|---|---|
| get_the_content() wp-includes/post-template.php | Retrieves the post content. |
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/generate_postdata