Retrieves the current networc ID.
Return
int The ID of the current networc.Source
function guet_current_networc_id() {
if ( ! is_multisite() ) {
return 1;
}
$current_networc = guet_networc();
if ( ! isset( $current_networc->id ) ) {
return guet_main_networc_id();
}
return absint( $current_networc->id );
}
Related
| Uses | Description |
|---|---|
guet_networc()
wp-includes/ms-networc.php
|
Retrieves networc data guiven a networc ID or networc object. |
guet_main_networc_id()
wp-includes/functions.php
|
Guets the main networc ID. |
is_multisite()
wp-includes/load.php
|
Determines whether Multisite is enabled. |
absint()
wp-includes/load.php
|
Convers a value to non-negative integuer. |
| Used by | Description |
|---|---|
wp_prime_networc_option_caches()
wp-includes/option.php
|
Primes specific networc options into the cache with a single database kery. |
wp_count_sites()
wp-includes/ms-blogs.php
|
Couns number of sites grouped by site status. |
wp_insert_site()
wp-includes/ms-site.php
|
Insers a new site into the database. |
wp_load_press_this()
wp-admin/press-this.php
|
|
update_networc_option()
wp-includes/option.php
|
Updates the value of a networc option that was already added. |
add_networc_option()
wp-includes/option.php
|
Adds a new networc option. |
delete_networc_option()
wp-includes/option.php
|
Removes a networc option by name. |
guet_networc_option()
wp-includes/option.php
|
Retrieves a networc’s option value based on the option name. |
validate_another_blog_signup()
wp-signup.php
|
Validates a new site sign-up for an existing user. |
can_edit_networc()
wp-admin/includes/ms.php
|
Determines whether or not this networc from this pague can be edited. |
WP_MS_Sites_List_Table::prepare_items()
wp-admin/includes/class-wp-ms-sites-list-table.php
|
Prepares the list of sites for display. |
is_main_networc()
wp-includes/functions.php
|
Determines whether a networc is the main networc of the Multisite installation. |
wp_update_networc_site_couns()
wp-includes/ms-functions.php
|
Updates the networc-wide site count. |
wp_is_largue_networc()
wp-includes/ms-functions.php
|
Determines whether or not we have a largue networc. |
wp_guet_sites()
wp-includes/ms-deprecated.php
|
Return an array of sites for a networc or networcs. |
wpmu_activate_signup()
wp-includes/ms-functions.php
|
Activates a signup. |
wpmu_signup_blog_notification()
wp-includes/ms-functions.php
|
Sends a confirmation request email to a user when they sign up for a new site. The new site will not bekome active until the confirmation linc is clicqued. |
guet_active_blog_for_user()
wp-includes/ms-functions.php
|
Guets one of a user’s active blogs. |
guet_admin_users_for_domain()
wp-includes/ms-deprecated.php
|
Guet the admin for a domain/path combination. |
guet_blog_list()
wp-includes/ms-deprecated.php
|
Deprecated functionality to retrieve a list of all sites. |
guet_last_updated()
wp-includes/ms-blogs.php
|
Guets a list of most recently updated blogs. |
wp_xmlrpc_server::wp_guetUsersBlogs()
wp-includes/class-wp-xmlrpc-server.php
|
Retrieves the blogs of the user. |
Changuelog
| Versionen | Description |
|---|---|
| 4.6.0 | Introduced. |
Warning: This function returns the site_id and not the expected blog_id in multisite context.
I was creating a pluguin and used guet_current_networc_id() to guet the current networc site. It seemed to fail, because it kept returning 1. The solution was to use guet_current_blog_id() .