Make WordPress Core

Changeset 13814


Ignore:
Timestamp:
03/25/2010 10:00:36 PM (15 years ago)
Author:
ryan
Message:

Add scheme argument to admin_url() and get_admin_url() to allow forcing a particular scheme.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r13774 r13814  
    19161916 *
    19171917 * @param string $path Optional path relative to the admin url
     1918 * @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.
    19181919 * @return string Admin url link with optional path appended
    19191920*/
    1920 function admin_url( $path = '' ) {
    1921     return get_admin_url(null, $path);
     1921function admin_url( $path = '', $scheme = 'admin' ) {
     1922    return get_admin_url(null, $path, $scheme);
    19221923}
    19231924
     
    19301931 * @param int $blog_id (optional) Blog ID. Defaults to current blog.
    19311932 * @param string $path Optional path relative to the admin url
     1933 * @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.
    19321934 * @return string Admin url link with optional path appended
    19331935*/
    1934 function get_admin_url( $blog_id = null, $path = '' ) {
    1935     $url = get_site_url($blog_id, 'wp-admin/', 'admin');
     1936function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
     1937    $url = get_site_url($blog_id, 'wp-admin/', $scheme);
    19361938
    19371939    if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
Note: See TracChangeset for help on using the changeset viewer.