Docs: Improve documentation for `get_page_by_title()`.

Props atachibana.
Fixes #47860.

git-svn-id: https://develop.svn.wordpress.org/trunk@45779 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-08-11 12:41:34 +00:00
parent 6ca6c447b9
commit 26592196e0
1 changed files with 9 additions and 1 deletions

View File

@ -4881,11 +4881,19 @@ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) {
/**
* Retrieve 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.
*
* @since 2.1.0
* @since 3.0.0 The `$post_type` parameter was added.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $page_title Page title
* @param string $page_title Page title.
* @param 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.
* @param string|array $post_type Optional. Post type or array of post types. Default 'page'.