General: Pass the scheme to the `*_url` filters.

This adds an additional `$scheme` parameter to the following URL related filters:
- `admin_url`.
- `includes_url`.
- `network_admin_url`.
- `user_admin_url`.

Props johnbillion, SergeyBiryukov, desrosj.
Fixes #52813.
Built from https://develop.svn.wordpress.org/trunk@51024


git-svn-id: http://core.svn.wordpress.org/trunk@50633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-05-26 01:47:59 +00:00
parent e2e8120fa6
commit 59b2dbb855
2 changed files with 29 additions and 17 deletions

View File

@ -3429,12 +3429,15 @@ function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
* Filters the admin area URL.
*
* @since 2.8.0
* @since 5.8.0 The `$scheme` parameter was added.
*
* @param string $url The complete admin area URL including scheme and path.
* @param string $path Path relative to the admin area URL. Blank string if no path is specified.
* @param int|null $blog_id Site ID, or null for the current site.
* @param string $url The complete admin area URL including scheme and path.
* @param string $path Path relative to the admin area URL. Blank string if no path is specified.
* @param int|null $blog_id Site ID, or null for the current site.
* @param string|null $scheme The scheme to use. Accepts 'http', 'https',
* 'admin', or null. Default 'admin', which obeys force_ssl_admin() and is_ssl().
*/
return apply_filters( 'admin_url', $url, $path, $blog_id );
return apply_filters( 'admin_url', $url, $path, $blog_id, $scheme );
}
/**
@ -3458,12 +3461,15 @@ function includes_url( $path = '', $scheme = null ) {
* Filters the URL to the includes directory.
*
* @since 2.8.0
* @since 5.8.0 The `$scheme` parameter was added.
*
* @param string $url The complete URL to the includes directory including scheme and path.
* @param string $path Path relative to the URL to the wp-includes directory. Blank string
* if no path is specified.
* @param string $url The complete URL to the includes directory including scheme and path.
* @param string $path Path relative to the URL to the wp-includes directory. Blank string
* if no path is specified.
* @param string|null $scheme Scheme to give the includes URL context. Accepts
* 'http', 'https', 'relative', or null. Default null.
*/
return apply_filters( 'includes_url', $url, $path );
return apply_filters( 'includes_url', $url, $path, $scheme );
}
/**
@ -3668,12 +3674,15 @@ function network_admin_url( $path = '', $scheme = 'admin' ) {
* Filters the network admin URL.
*
* @since 3.0.0
* @since 5.8.0 The `$scheme` parameter was added.
*
* @param string $url The complete network admin URL including scheme and path.
* @param string $path Path relative to the network admin URL. Blank string if
* no path is specified.
* @param string $url The complete network admin URL including scheme and path.
* @param string $path Path relative to the network admin URL. Blank string if
* no path is specified.
* @param string|null $scheme The scheme to use. Accepts 'http', 'https',
* 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
*/
return apply_filters( 'network_admin_url', $url, $path );
return apply_filters( 'network_admin_url', $url, $path, $scheme );
}
/**
@ -3697,12 +3706,15 @@ function user_admin_url( $path = '', $scheme = 'admin' ) {
* Filters the user admin URL for the current user.
*
* @since 3.1.0
* @since 5.8.0 The `$scheme` parameter was added.
*
* @param string $url The complete URL including scheme and path.
* @param string $path Path relative to the URL. Blank string if
* no path is specified.
* @param string $url The complete URL including scheme and path.
* @param string $path Path relative to the URL. Blank string if
* no path is specified.
* @param string|null $scheme The scheme to use. Accepts 'http', 'https',
* 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
*/
return apply_filters( 'user_admin_url', $url, $path );
return apply_filters( 'user_admin_url', $url, $path, $scheme );
}
/**

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-51023';
$wp_version = '5.8-alpha-51024';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.