Retrieves page data given a page ID or page object.
Description
Use get_post() instead of get_page() .
Parameters
$pageint|WP_Postrequired- 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 $filterstringoptional- How the return value should be filtered. Accepts
'raw','edit','db','display'. Default'raw'.Default:
'raw'
Source
function get_page( $page, $output = OBJECT, $filter = 'raw' ) {
return get_post( $page, $output, $filter );
}
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Use get_post() |
| 1.5.1 | Introduced. |
Add the content of a page anywhere with separated title.