WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp get single post


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.

Contents

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

See also index of Function Reference and index of Template Tags.