network_admin_url( string $path = '', string $scheme = 'admin' )
Récupère l'url de l'administration réseau.
Paramètres
$path
(string) (Optionnel) Chemin relatif à l'url de l'administration Wordpress.
Valeur par défaut : ''
$scheme
(string) (Optionnel) Le schema à utiliser. Accepte 'http' ou 'https'.
Valeur par défaut : 'admin'
Retourne
(string) L'url de l'administration réseau avec l'ajout d'un chemin optionnel.
Structure de la fonction network_admin_url()
Définie dans le fichier wp-includes/link-template.php à la ligne 3557 :
function network_admin_url( $path = '', $scheme = 'admin' ) {
if ( ! is_multisite() ) {
return admin_url( $path, $scheme );
}
$url = network_site_url( 'wp-admin/network/', $scheme );
if ( $path && is_string( $path ) ) {
$url .= ltrim( $path, '/' );
}
/**
* Filters the network admin URL.
*
* @since 3.0.0
*
* @param string $url The complete network admin URL including scheme and path.
* @param string $path Path relative to the network admin URL. Blank string if
* no path is specified.
*/
return apply_filters( 'network_admin_url', $url, $path );
}
Fonctions et Hook utilisés par network_admin_url()
is_multisite()
Vérifie si le multisite est autorisé.
admin_url()
Retourne l'url de l'administration du site actuel.
network_site_url()
Récupère l'url d'un site pour le réseau actuel.
network_admin_url
Filtre l'url de l'administration réseau.
apply_filters()
Appel les fonctions qui ont été attaché à un filtre (hook).
Où trouver la fonction network_admin_url()
dans le CMS Wordpress
Exemple
Sources
Codex Wordpress : network_admin_url()
Autres fonctions dans le même fichier : wp-includes/link-template.php