network_admin_url() WP 3.0.0
Retrieves the URL to the admin panel for the network — many sites management (not for a single blog of the network): /wp-admin/network
.
If call this function on single site instalation (not Multisite) the admin_url() function will be called.
Works based on: network_site_url()
Hooks from the function
Return
String. Admin URL link with optional path appended.
Usage
network_admin_url( $path, $scheme );
- $path(строка)
- The path to a specific page of the admin. Will be added to the URL.
Default: '' - $scheme(строка)
The Protocol to be used. Can be:
http
https
relative
- returns a relative URL (without domain).
Function uses get_site_url(), therefore it also understands all its parameter values.
Default: 'admin', which obeys force_ssl_admin() and is_ssl()
Examples
#1 Get the URL to the admin area for the network
$url = network_admin_url(); /* The result: http://example.com/wp-admin/network/ Or if SSL is used: https://example.com/wp-admin/network/ */
#2 Get the URL to the specific page of the network admin area
This example demonstrates how to add a path and specify the protocol and what the function will return.
In this example we want to get the URL to the «Users - Add new» page, and specify the protocol (scheme) to https.
$url = network_admin_url( 'user-new.php', 'https' ); //> https://example.com/wp-admin/network/user-new.php
Changelog
Since 3.0.0 | Introduced. |
Code of network_admin_url() network admin url WP 5.6
Related Functions
From tag: Link (URL)
- admin_url()
- attachment_url_to_postid()
- build_query()
- comment_link()
- content_url()
- get_comments_link()
- get_comments_pagenum_link()
- get_edit_post_link()
- get_edit_term_link()
- get_home_url()
- get_next_comments_link()
- get_post_embed_url()
- get_post_permalink()