Uses
Uses | Description |
---|---|
wp-includes/functions.php: _deprecated_function() | Mark a function as deprecated and inform when it has been used. |
wp-includes/post.php: get_post() | Retrieves post data given a post ID or post object. |
This function has been deprecated. Use get_post() instead.
Retrieves all post data for a given post.
(int) (Required) Post ID.
(array) Post data.
File: wp-includes/deprecated.php
function get_postdata($postid) { _deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' ); $post = get_post($postid); $postdata = array ( 'ID' => $post->ID, 'Author_ID' => $post->post_author, 'Date' => $post->post_date, 'Content' => $post->post_content, 'Excerpt' => $post->post_excerpt, 'Title' => $post->post_title, 'Category' => $post->post_category, 'post_status' => $post->post_status, 'comment_status' => $post->comment_status, 'ping_status' => $post->ping_status, 'post_password' => $post->post_password, 'to_ping' => $post->to_ping, 'pinged' => $post->pinged, 'post_type' => $post->post_type, 'post_name' => $post->post_name ); return $postdata; }
Version | Description |
---|---|
1.5.1 | Use get_post() |
0.71 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_postdata