Retrieves page data given a page ID or page object.
Description
Use get_post() instead of get_page().
Parameters
$pageint|WP_Post
Page object or page ID. Passed by reference.
$outputstringoptional
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.Default: OBJECT
$filterstringoptional
How the return value should be filtered. Accepts 'raw', 'edit', 'db', 'display'. Default 'raw'.Default: 'raw'
Return
WP_Post|array|null
WP_Post or array on success, null on failure.
Uses · 1
get_post()Retrieves post data given a post ID or post object.
Signature, return type and hooks compared across 5 parsed releases.
3.5.0
Deprecated. Use get_post()from the docblock
1.5.1
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/post.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.