WordPress开发者和主题制作者的搜索引擎



get_page ›

Since1.5.1
已弃用3.5.0
get_page ( $page, $output = OBJECT, $filter = 'raw' )
参数: (3)
  • (mixed) $page Page object or page ID. Passed by reference.
    Required: Yes
  • (string) $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
    Required: No
    默认: OBJECT
  • (string) $filter Optional. How the return value should be filtered. Accepts 'raw', 'edit', 'db', 'display'. Default 'raw'.
    Required: No
    默认: 'raw'
返回:
  • (WP_Post|array|null) WP_Post (or array) on success, or null on failure.
定义在:
文档:

Retrieves page data given a page ID or page object.

Use get_post() instead of get_page().



源码

function get_page( $page, $output = OBJECT, $filter = 'raw' ) {
	return get_post( $page, $output, $filter );
}