- get_page_by_title is deprecated since version 6.2.0!
get_page_by_title ( $page_title, $output = OBJECT, $post_type = 'page' )
- (string) page_title Page title.
- (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.
- (string|array) post_type Optional. Post type or array of post types. Default 'page'.
Defined at:Change Log:
- (WP_Post|array|null) WP_Post (or array) on success, or null on failure.
- Introduced in WordPress: 2.1.0
- Deprecated in WordPress: 6.2.0
Retrieves a page given its title.If more than one post uses the same title, the post with the smallest ID will be returned.
Be careful: in case of more than one post having the same title, it will check the oldest
publication date, not the smallest ID.
Because this function uses the MySQL '=' comparison, $page_title will usually be matched
as case-insensitive with default collation.