From 80d153fb70e90eefd223e8d969e03fe35ec91590 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 11 Aug 2019 12:42:56 +0000 Subject: [PATCH] Docs: Improve documentation for `get_page_by_title()`. Props atachibana. Fixes #47860. Built from https://develop.svn.wordpress.org/trunk@45779 git-svn-id: http://core.svn.wordpress.org/trunk@45590 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 10 +++++++++- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index ae688a3470..7636c3d02b 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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'. diff --git a/wp-includes/version.php b/wp-includes/version.php index 2976c02554..2f97c45fae 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45778'; +$wp_version = '5.3-alpha-45779'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.