WordPress函数wp_get_single_post()通过ID获取指定的文章

描述:

通过ID获取指定的文章

用法:

<?php wp_get_single_post( $postid, $mode ) ?>

参数:

$postid

(integer) (可选) Post ID.

默认值: 0

$mode

(string) (可选) How to return result. Expects a Constant: OBJECT, ARRAY_N, or ARRAY_A.

默认值: OBJECT

源文件:

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