Make WordPress Core

Changeset 41060


Ignore:
Timestamp:
07/14/2017 11:00:55 PM (9 years ago)
Author:
flixos90
Message:

Multisite: Introduce a self_admin_url filter to adjust the URL to an administration panel.

Props j.hoffmann.
Fixes #37446.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r40975 r41060  
    33983398 */
    33993399function self_admin_url( $path = '', $scheme = 'admin' ) {
    3400         if ( is_network_admin() )
    3401                 return network_admin_url($path, $scheme);
    3402         elseif ( is_user_admin() )
    3403                 return user_admin_url($path, $scheme);
    3404         else
    3405                 return admin_url($path, $scheme);
     3400        if ( is_network_admin() ) {
     3401                $url = network_admin_url( $path, $scheme );
     3402        } elseif ( is_user_admin() ) {
     3403                $url = user_admin_url( $path, $scheme );
     3404        } else {
     3405                $url = admin_url( $path, $scheme );
     3406        }
     3407
     3408        /**
     3409         * Filters the admin URL for the current site or network depending on context.
     3410         *
     3411         * @since 4.9.0
     3412         *
     3413         * @param string $url    The complete URL including scheme and path.
     3414         * @param string $path   Path relative to the URL. Blank string if no path is specified.
     3415         * @param string $scheme The scheme to use.
     3416         */
     3417        return apply_filters( 'self_admin_url', $url, $path, $scheme );
    34063418}
    34073419
Note: See TracChangeset for help on using the changeset viewer.