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.