This function has been deprecated since Version 3.5. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php.
Use
get_post instead.
This page redirects to an external site: https://developer.wordpress.org/reference/functions/wp_get_single_post/
Languages:
English •
get single post 日本語
Русский •
(Add your language)
Description
Retrieve a single post, based on post ID.
Usage
<?php wp_get_single_post( $postid, $mode ) ?>
Parameters
- $postid
- (integer) (optional) Post ID.
- Default: 0
- $mode
- (string) (optional) How to return result. Expects a Constant: OBJECT, ARRAY_N, or ARRAY_A.
- Default: OBJECT
Return Values
- (object|array)
- Post object or array holding post contents and information with two additional fields (or keys): 'post_category' and 'tags_input'.
Examples
Notes
Change Log
- Deprecated: 3.5.0
- Since: 1.0.0
Source File
wp_get_single_post() is located in wp-includes/post.php.
Related