Make WordPress Core

Changeset 51024


Ignore:
Timestamp:
05/26/2021 01:46:10 AM (2 years ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

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

    r50505 r51024  
    34303430     *
    34313431     * @since 2.8.0
    3432      *
    3433      * @param string   $url     The complete admin area URL including scheme and path.
    3434      * @param string   $path    Path relative to the admin area URL. Blank string if no path is specified.
    3435      * @param int|null $blog_id Site ID, or null for the current site.
    3436      */
    3437     return apply_filters( 'admin_url', $url, $path, $blog_id );
     3432     * @since 5.8.0 The `$scheme` parameter was added.
     3433     *
     3434     * @param string      $url     The complete admin area URL including scheme and path.
     3435     * @param string      $path    Path relative to the admin area URL. Blank string if no path is specified.
     3436     * @param int|null    $blog_id Site ID, or null for the current site.
     3437     * @param string|null $scheme  The scheme to use. Accepts 'http', 'https',
     3438     *                             'admin', or null. Default 'admin', which obeys force_ssl_admin() and is_ssl().
     3439     */
     3440    return apply_filters( 'admin_url', $url, $path, $blog_id, $scheme );
    34383441}
    34393442
     
    34593462     *
    34603463     * @since 2.8.0
    3461      *
    3462      * @param string $url  The complete URL to the includes directory including scheme and path.
    3463      * @param string $path Path relative to the URL to the wp-includes directory. Blank string
    3464      *                     if no path is specified.
    3465      */
    3466     return apply_filters( 'includes_url', $url, $path );
     3464     * @since 5.8.0 The `$scheme` parameter was added.
     3465     *
     3466     * @param string      $url    The complete URL to the includes directory including scheme and path.
     3467     * @param string      $path   Path relative to the URL to the wp-includes directory. Blank string
     3468     *                            if no path is specified.
     3469     * @param string|null $scheme Scheme to give the includes URL context. Accepts
     3470     *                            'http', 'https', 'relative', or null. Default null.
     3471     */
     3472    return apply_filters( 'includes_url', $url, $path, $scheme );
    34673473}
    34683474
     
    36693675     *
    36703676     * @since 3.0.0
    3671      *
    3672      * @param string $url  The complete network admin URL including scheme and path.
    3673      * @param string $path Path relative to the network admin URL. Blank string if
    3674      *                     no path is specified.
    3675      */
    3676     return apply_filters( 'network_admin_url', $url, $path );
     3677     * @since 5.8.0 The `$scheme` parameter was added.
     3678     *
     3679     * @param string      $url    The complete network admin URL including scheme and path.
     3680     * @param string      $path   Path relative to the network admin URL. Blank string if
     3681     *                            no path is specified.
     3682     * @param string|null $scheme The scheme to use. Accepts 'http', 'https',
     3683     *                            'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
     3684     */
     3685    return apply_filters( 'network_admin_url', $url, $path, $scheme );
    36773686}
    36783687
     
    36983707     *
    36993708     * @since 3.1.0
    3700      *
    3701      * @param string $url  The complete URL including scheme and path.
    3702      * @param string $path Path relative to the URL. Blank string if
    3703      *                     no path is specified.
    3704      */
    3705     return apply_filters( 'user_admin_url', $url, $path );
     3709     * @since 5.8.0 The `$scheme` parameter was added.
     3710     *
     3711     * @param string      $url    The complete URL including scheme and path.
     3712     * @param string      $path   Path relative to the URL. Blank string if
     3713     *                            no path is specified.
     3714     * @param string|null $scheme The scheme to use. Accepts 'http', 'https',
     3715     *                            'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
     3716     */
     3717    return apply_filters( 'user_admin_url', $url, $path, $scheme );
    37063718}
    37073719
Note: See TracChangeset for help on using the changeset viewer.