2020-05-01 / 4651阅 / 悠然
Retrieves post data given a post ID or post object.
See sanitize_post() for optional $filter values. Also, the parameter $post, must be given as a variable, since it is passed by reference.
(int|WP_Post|null)
(Optional)
Post ID or post object. Defaults to global $post.
Default value: null
(string)
(Optional)
The required return type.>WP_Post object, an associative array, or a numeric array, respectively.
Default value: OBJECT
(string)
(Optional)
Type of filter to apply. Accepts 'raw', 'edit', 'db', or 'display'.
Default value: 'raw'
(WP_Post|array|null) Type corresponding to $output on success or null on failure. When $output is OBJECT, a WP_Post instance is returned.