diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index a5d5b3df1..5ea766a73 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2269,6 +2269,23 @@ function self_admin_url($path = '', $scheme = 'admin') { return admin_url($path, $scheme); } +/** + * Retrieve the url to the admin area for either the current blog or the network + * depending on whether multisite is enabled. + * + * @since 3.1.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 maybe_network_admin_url( $path = '', $scheme = 'admin' ) { + if ( is_multisite() ) + return network_admin_url( $path, $scheme ); + else + return admin_url( $path, $scheme ); +} + /** * Get the URL to the user's dashboard. *