This function has been deprecated. Use get_post() instead.
wp_get_single_post( int $postid, string $mode = OBJECT )
Retrieve a single post, based on post ID.
Description
Has categories in ‘post_category’ property or key. Has tags in ‘tags_input’ property or key.
See also
Parameters
- $postid
-
(Required) Post ID.
- $mode
-
(Optional) How to return result, either OBJECT, ARRAY_N, or ARRAY_A.
Default value: OBJECT
Return
(WP_Post|null) Post object or array holding post contents and information
Source
File: wp-includes/deprecated.php
function wp_get_single_post( $postid = 0, $mode = OBJECT ) {
_deprecated_function( __FUNCTION__, 'WP-3.5.0', 'get_post()' );
return get_post( $postid, $mode );
}
Changelog
Version | Description |
---|---|
3.5.0 | Use get_post() |
1.0.0 | Introduced. This function has been deprecated. Use get_post() instead. |