From 0286b0f2e5c5c8799060e764027801ce81cee274 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 25 Mar 2010 22:00:36 +0000 Subject: [PATCH] Add scheme argument to admin_url() and get_admin_url() to allow forcing a particular scheme. git-svn-id: https://develop.svn.wordpress.org/trunk@13814 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 4b93688147..f1e368b03a 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1915,10 +1915,11 @@ function get_site_url( $blog_id = null, $path = '', $scheme = null ) { * @since 2.6.0 * * @param string $path Optional path relative to the admin url + * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. * @return string Admin url link with optional path appended */ -function admin_url( $path = '' ) { - return get_admin_url(null, $path); +function admin_url( $path = '', $scheme = 'admin' ) { + return get_admin_url(null, $path, $scheme); } /** @@ -1929,10 +1930,11 @@ function admin_url( $path = '' ) { * * @param int $blog_id (optional) Blog ID. Defaults to current blog. * @param string $path Optional path relative to the admin url + * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes. * @return string Admin url link with optional path appended */ -function get_admin_url( $blog_id = null, $path = '' ) { - $url = get_site_url($blog_id, 'wp-admin/', 'admin'); +function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) { + $url = get_site_url($blog_id, 'wp-admin/', $scheme); if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) $url .= ltrim($path, '/');