get_site_option( string $option, mixed $default_value = false, bool $deprecated = true ): mixed
Retrieve an option value for the current network based on name of option.
Contents
Description
See also
Parameters
-
$option
string Required -
Name of the option to retrieve. Expected to not be SQL-escaped.
-
$default_value
mixed Optional -
Value to return if the option doesn't exist.
Default:
false
-
$deprecated
bool Optional -
Whether to use cache. Multisite only. Always set to true.
Default:
true
Return
mixed Value set for the option.
More Information
This function is almost identical to get_option() , except that in multisite, it returns the network-wide option. For non-multisite installs, it uses get_option.
It is easy to get confused about the difference between get_option() and get_site_option() , because multisite used different terms before. Now there are different “sites” on a “network”, before there where different “blogs” on a “site”. Many functions and variables were introduced before this change, such as this one. Think of this function as “get_network_option()“
Source
File: wp-includes/option.php
.
View all references
function get_site_option( $option, $default_value = false, $deprecated = true ) {
return get_network_option( null, $option, $default_value );
}
Related
Uses
Uses | Description |
---|---|
get_network_option() wp-includes/option.php |
Retrieves a network’s option value based on the option name. |
Used By
Used By | Description |
---|---|
deactivated_plugins_notice() wp-admin/includes/plugin.php |
Renders an admin notice when a plugin was deactivated during an update. |
wpmu_new_site_admin_notification() wp-includes/ms-functions.php |
Notifies the Multisite network administrator that a new site was created. |
core_auto_updates_settings() wp-admin/update-core.php |
Display WordPress auto-updates settings. |
WP_Automatic_Updater::send_plugin_theme_email() wp-admin/includes/class-wp-automatic-updater.php |
Sends an email upon the completion or failure of a plugin or theme background update. |
WP_MS_Themes_List_Table::column_autoupdates() wp-admin/includes/class-wp-ms-themes-list-table.php |
Handles the auto-updates column output. |
wp_ajax_toggle_auto_updates() wp-admin/includes/ajax-actions.php |
Ajax handler to enable or disable plugin and theme auto-updates. |
WP_Recovery_Mode_Cookie_Service::recovery_mode_hash() wp-includes/class-wp-recovery-mode-cookie-service.php |
Gets a form of |
WP_Debug_Data::debug_data() wp-admin/includes/class-wp-debug-data.php |
Static function for generating site debug data when required. |
WP_Site_Health_Auto_Updates::test_if_failed_update() wp-admin/includes/class-wp-site-health-auto-updates.php |
Checks if automatic updates have tried to run, but failed, previously. |
populate_network_meta() wp-admin/includes/schema.php |
Creates WordPress network meta and sets the default values. |
WP_REST_Attachments_Controller::check_upload_size() wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php |
Determine if uploaded file exceeds space quota on multisite. |
_wp_privacy_send_request_confirmation_notification() wp-includes/user.php |
Notifies the site administrator via email when a request is confirmed. |
update_network_option_new_admin_email() wp-includes/ms-functions.php |
Sends a confirmation request email when a change of network admin email address is attempted. |
wp_network_admin_email_change_notification() wp-includes/ms-functions.php |
Sends an email to the old network admin email address when the network admin email address changes. |
WP_Theme::network_enable_theme() wp-includes/class-wp-theme.php |
Enables a theme for all sites on the current network. |
WP_Theme::network_disable_theme() wp-includes/class-wp-theme.php |
Disables a theme for all sites on the current network. |
_wp_upload_dir() wp-includes/functions.php |
A non-filtered, non-cached version of wp_upload_dir() that doesn’t check the path. |
show_blog_form() wp-signup.php |
Generates and displays the Sign-up and Create Site forms. |
network_step2() wp-admin/includes/network.php |
Prints step 2 for Network installation process. |
WP_Automatic_Updater::after_core_update() wp-admin/includes/class-wp-automatic-updater.php |
If we tried to perform a core update, check if we should send an email, and if we need to avoid processing future updates. |
WP_Automatic_Updater::send_email() wp-admin/includes/class-wp-automatic-updater.php |
Sends an email upon the completion or failure of a background core update. |
WP_Automatic_Updater::send_debug_email() wp-admin/includes/class-wp-automatic-updater.php |
Prepares and sends an email of a full log of background update results, useful for debugging and geekery. |
WP_Automatic_Updater::should_update() wp-admin/includes/class-wp-automatic-updater.php |
Tests to see if we can and should update a specific item. |
WP_Automatic_Updater::send_core_update_notification_email() wp-admin/includes/class-wp-automatic-updater.php |
Notifies an administrator of a core update. |
Core_Upgrader::should_update_to_version() wp-admin/includes/class-core-upgrader.php |
Determines if this WordPress Core version should update to an offered version or not. |
wp_prepare_themes_for_js() wp-admin/includes/theme.php |
Prepares themes for JavaScript. |
WP_Plugins_List_Table::single_row() wp-admin/includes/class-wp-plugins-list-table.php | |
WP_Plugins_List_Table::prepare_items() wp-admin/includes/class-wp-plugins-list-table.php | |
site_admin_notice() wp-admin/includes/ms.php |
Displays an admin notice to upgrade all sites after a core upgrade. |
grant_super_admin() wp-includes/capabilities.php |
Grants Super Admin privileges. |
revoke_super_admin() wp-includes/capabilities.php |
Revokes Super Admin privileges. |
upload_is_user_over_quota() wp-admin/includes/ms.php |
Checks whether a site has used its allotted upload space. |
check_upload_size() wp-admin/includes/ms.php |
Determines whether uploaded file exceeds space quota. |
wpmu_delete_blog() wp-admin/includes/ms.php |
Deletes a site. |
WP_MS_Themes_List_Table::prepare_items() wp-admin/includes/class-wp-ms-themes-list-table.php | |
maintenance_nag() wp-admin/includes/update.php |
Displays maintenance nag HTML message. |
get_core_updates() wp-admin/includes/update.php |
Gets available core updates. |
dismiss_core_update() wp-admin/includes/update.php |
Dismisses core update. |
undismiss_core_update() wp-admin/includes/update.php |
Undismisses core update. |
wp_dashboard_quota() wp-admin/includes/dashboard.php |
Displays file upload quota on dashboard. |
upgrade_network() wp-admin/includes/upgrade.php |
Executes network-level upgrade routines. |
wp_install_defaults() wp-admin/includes/upgrade.php |
Creates the initial content for a newly-installed site. |
is_plugin_active_for_network() wp-admin/includes/plugin.php |
Determines whether the plugin is active for the entire network. |
activate_plugin() wp-admin/includes/plugin.php |
Attempts activation of plugin in a “sandbox” and redirects on success. |
deactivate_plugins() wp-admin/includes/plugin.php |
Deactivates a single plugin or multiple plugins. |
validate_active_plugins() wp-admin/includes/plugin.php |
Validates active plugins. |
WP_Themes_List_Table::no_items() wp-admin/includes/class-wp-themes-list-table.php | |
list_plugin_updates() wp-admin/update-core.php |
Display the upgrade plugins form. |
list_theme_updates() wp-admin/update-core.php |
Display the upgrade themes form. |
get_super_admins() wp-includes/capabilities.php |
Retrieves a list of super admins. |
map_meta_cap() wp-includes/capabilities.php |
Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. |
get_locale() wp-includes/l10n.php |
Retrieves the current locale. |
wp_salt() wp-includes/pluggable.php |
Returns a salt to add to hashes. |
WP_Theme::get_allowed_on_network() wp-includes/class-wp-theme.php |
Returns array of stylesheet names of themes allowed on the network. |
wp_cookie_constants() wp-includes/default-constants.php |
Defines cookie-related WordPress constants. |
wp_version_check() wp-includes/update.php |
Checks WordPress version against the newest version. |
set_site_transient() wp-includes/option.php |
Sets/updates the value of a site transient. |
get_site_transient() wp-includes/option.php |
Retrieves the value of a site transient. |
wp_get_user_contact_methods() wp-includes/user.php |
Sets up the user contact methods. |
get_space_allowed() wp-includes/ms-functions.php |
Returns the upload quota for the current blog. |
get_upload_space_available() wp-includes/ms-functions.php |
Determines if there is any upload space left in the current blog’s quota. |
is_upload_space_available() wp-includes/ms-functions.php |
Determines if there is any upload space left in the current blog’s quota. |
upload_size_limit_filter() wp-includes/ms-functions.php |
Filters the maximum upload file size allowed, in bytes. |
users_can_register_signup_filter() wp-includes/ms-functions.php |
Determines whether users can self-register, based on Network settings. |
wpmu_welcome_user_notification() wp-includes/ms-functions.php |
Notifies a user that their account activation has been successful. |
check_upload_mimes() wp-includes/ms-functions.php |
Checks an array of MIME types against a list of allowed types. |
upload_is_file_too_big() wp-includes/ms-functions.php |
Checks whether an upload is too big. |
install_blog() wp-includes/ms-deprecated.php |
Install an empty blog. |
newblog_notify_siteadmin() wp-includes/ms-functions.php |
Notifies the network admin that a new site has been activated. |
newuser_notify_siteadmin() wp-includes/ms-functions.php |
Notifies the network admin that a new user has been activated. |
wpmu_welcome_notification() wp-includes/ms-functions.php |
Notifies the site administrator that their site activation was successful. |
is_email_address_unsafe() wp-includes/ms-functions.php |
Checks an email address against a list of banned domains. |
wpmu_validate_user_signup() wp-includes/ms-functions.php |
Sanitizes and validates data required for a user sign-up. |
wpmu_validate_blog_signup() wp-includes/ms-functions.php |
Processes new site registrations. |
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 become active until the confirmation link is clicked. |
wpmu_signup_user_notification() wp-includes/ms-functions.php |
Sends a confirmation request email to a user when they sign up for a new user account (without signing up for a site at the same time). The user account will not become active until the confirmation link is clicked. |
wp_get_active_network_plugins() wp-includes/ms-load.php |
Returns array of network plugin files to be included in global scope. |
ms_site_check() wp-includes/ms-load.php |
Checks status of current blog. |
get_dashboard_blog() wp-includes/ms-deprecated.php |
Get the “dashboard blog”, the blog where users without a blog edit their profile data. |
ms_upload_constants() wp-includes/ms-default-constants.php |
Defines Multisite upload constants. |
script_concat_settings() wp-includes/script-loader.php |
Determines the concatenation and compression settings for scripts and styles. |
Changelog
Version | Description |
---|---|
4.4.0 | Modified into wrapper for get_network_option() |
2.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Default Usage
Passing a Default Value