From 6dd28116a16bdc67e507a786a4fa8c8fbdaa77ca Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 6 Nov 2020 14:03:06 +0000 Subject: [PATCH] Docs: Improve return value description for `esc_url()`. Add a reference to `esc_url()` from `esc_url_raw()` return value description. Props stevenlinx, audrasjb, helen. Fixes #50585. Built from https://develop.svn.wordpress.org/trunk@49512 git-svn-id: http://core.svn.wordpress.org/trunk@49267 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index f5930d4ec0..4031740aba 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -4301,6 +4301,8 @@ function esc_sql( $data ) { * Defaults to return value of wp_allowed_protocols(). * @param string $_context Private. Use esc_url_raw() for database usage. * @return string The cleaned URL after the {@see 'clean_url'} filter is applied. + * An empty string is returned if `$url` specifies a protocol other than + * those in `$protocols`, or if `$url` contains an empty string. */ function esc_url( $url, $protocols = null, $_context = 'display' ) { $original_url = $url; @@ -4408,7 +4410,7 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) { * @param string $url The URL to be cleaned. * @param string[] $protocols Optional. An array of acceptable protocols. * Defaults to return value of wp_allowed_protocols(). - * @return string The cleaned URL. + * @return string The cleaned URL after esc_url() is run with the 'db' context. */ function esc_url_raw( $url, $protocols = null ) { return esc_url( $url, $protocols, 'db' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 9fcc36a03e..459971671d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta3-49511'; +$wp_version = '5.6-beta3-49512'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.