Core Function
View Source on Trac ↗ get_page_by_path()
get_page_by_path( mixed $page_path, mixed $output = OBJECT, mixed $post_type = 'page' ) Retrieves a page given its path.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $page_path string | Page path. Required |
| 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 |
| (string | | array) $post_type Optional. Post type or array of post types. Default 'page'. Required |
Return Value
((WP_Post)
| array | null) WP_Post (or array) on success, or null on failure.
Function Information
Since Version
2.1.0
Source File
wp-includes/post.php
Advertisement