Warning: 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.

Has categories in ‘post_category’ property or key. Has tags in ‘tags_input’ property or key.

Return: (WP_Post|null) Post object or array holding post contents and information

Source file: wp-includes/deprecated.php

View source


Parameters

$postid

(int) (Required) Post ID.

$mode

(string) (Optional) How to return result, either OBJECT, ARRAY_N, or ARRAY_A.

Default value: OBJECT


Used by


Source

function wp_get_single_post( $postid = 0, $mode = OBJECT ) {
	_deprecated_function( __FUNCTION__, '3.5', 'get_post()' );
	return get_post( $postid, $mode );
}


Changelog


User Contributed Notes

You must log in before being able to contribute a note.