get_site_option( string $option, mixed $default = false, bool $deprecated = true )
Retrieve an option value for the current network based on name of option.
Description
See also
Parameters
- $option
-
(string) (Required) Name of the option to retrieve. Expected to not be SQL-escaped.
- $default
-
(mixed) (Optional) Value to return if the option doesn't exist.
Default value: false
- $deprecated
-
(bool) (Optional) Whether to use cache. Multisite only. Always set to true.
Default value: 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
function get_site_option( $option, $default = false, $deprecated = true ) { return get_network_option( null, $option, $default ); }
Related
Uses
Uses | Description |
---|---|
wp-includes/option.php: get_network_option() | Retrieves a network’s option value based on the option name. |
Used By
Used By | Description |
---|---|
wp-admin/includes/plugin.php: deactivated_plugins_notice() | Renders an admin notice when a plugin was deactivated during an update. |
wp-includes/ms-functions.php: wpmu_new_site_admin_notification() | Notifies the Multisite network administrator that a new site was created. |
wp-admin/update-core.php: core_auto_updates_settings() | Display WordPress auto-updates settings. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::send_plugin_theme_email() | Sends an email upon the completion or failure of a plugin or theme background update. |
wp-admin/includes/class-wp-ms-themes-list-table.php: WP_MS_Themes_List_Table::column_autoupdates() | Handles the auto-updates column output. |
wp-admin/includes/ajax-actions.php: wp_ajax_toggle_auto_updates() | Ajax handler to enable or disable plugin and theme auto-updates. |
wp-includes/class-wp-recovery-mode-cookie-service.php: WP_Recovery_Mode_Cookie_Service::recovery_mode_hash() | Gets a form of |
wp-admin/includes/class-wp-debug-data.php: WP_Debug_Data::debug_data() | Static function for generating site debug data when required. |
wp-admin/includes/class-wp-site-health-auto-updates.php: WP_Site_Health_Auto_Updates::test_if_failed_update() | Check if automatic updates have tried to run, but failed, previously. |
wp-admin/includes/schema.php: populate_network_meta() | Creates WordPress network meta and sets the default values. |
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php: WP_REST_Attachments_Controller::check_upload_size() | Determine if uploaded file exceeds space quota on multisite. |
wp-includes/user.php: _wp_privacy_send_request_confirmation_notification() | Notify the site administrator via email when a request is confirmed. |
wp-includes/ms-functions.php: update_network_option_new_admin_email() | Send a confirmation request email when a change of network admin email address is attempted. |
wp-includes/ms-functions.php: wp_network_admin_email_change_notification() | Send an email to the old network admin email address when the network admin email address changes. |
wp-includes/class-wp-theme.php: WP_Theme::network_enable_theme() | Enables a theme for all sites on the current network. |
wp-includes/class-wp-theme.php: WP_Theme::network_disable_theme() | Disables a theme for all sites on the current network. |
wp-includes/functions.php: _wp_upload_dir() | A non-filtered, non-cached version of wp_upload_dir() that doesn’t check the path. |
wp-signup.php: show_blog_form() | Generates and displays the Signup and Create Site forms |
wp-admin/includes/network.php: network_step2() | Prints step 2 for Network installation process. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::after_core_update() | 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-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::send_email() | Sends an email upon the completion or failure of a background core update. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::send_debug_email() | Prepares and sends an email of a full log of background update results, useful for debugging and geekery. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::should_update() | Tests to see if we can and should update a specific item. |
wp-admin/includes/class-wp-automatic-updater.php: WP_Automatic_Updater::send_core_update_notification_email() | Notifies an administrator of a core update. |
wp-admin/includes/class-core-upgrader.php: Core_Upgrader::should_update_to_version() | Determines if this WordPress Core version should update to an offered version or not. |
wp-admin/includes/theme.php: wp_prepare_themes_for_js() | Prepare themes for JavaScript. |
wp-admin/includes/class-wp-plugins-list-table.php: WP_Plugins_List_Table::single_row() | |
wp-admin/includes/class-wp-plugins-list-table.php: WP_Plugins_List_Table::prepare_items() | |
wp-admin/includes/ms.php: site_admin_notice() | Displays an admin notice to upgrade all sites after a core upgrade. |
wp-includes/capabilities.php: grant_super_admin() | Grants Super Admin privileges. |
wp-includes/capabilities.php: revoke_super_admin() | Revokes Super Admin privileges. |
wp-admin/includes/ms.php: upload_is_user_over_quota() | Check whether a site has used its allotted upload space. |
wp-admin/includes/ms.php: check_upload_size() | Determine if uploaded file exceeds space quota. |
wp-admin/includes/ms.php: wpmu_delete_blog() | Delete a site. |
wp-admin/includes/class-wp-ms-themes-list-table.php: WP_MS_Themes_List_Table::prepare_items() | |
wp-admin/includes/update.php: maintenance_nag() | |
wp-admin/includes/update.php: get_core_updates() | Gets available core updates. |
wp-admin/includes/update.php: dismiss_core_update() | Dismisses core update. |
wp-admin/includes/update.php: undismiss_core_update() | Undismisses core update. |
wp-admin/includes/dashboard.php: wp_dashboard_quota() | Displays file upload quota on dashboard. |
wp-admin/includes/upgrade.php: upgrade_network() | Executes network-level upgrade routines. |
wp-admin/includes/upgrade.php: wp_install_defaults() | Creates the initial content for a newly-installed site. |
wp-admin/includes/plugin.php: is_plugin_active_for_network() | Determines whether the plugin is active for the entire network. |
wp-admin/includes/plugin.php: activate_plugin() | Attempts activation of plugin in a “sandbox” and redirects on success. |
wp-admin/includes/plugin.php: deactivate_plugins() | Deactivate a single plugin or multiple plugins. |
wp-admin/includes/plugin.php: validate_active_plugins() | Validate active plugins |
wp-admin/includes/class-wp-themes-list-table.php: WP_Themes_List_Table::no_items() | |
wp-admin/update-core.php: list_plugin_updates() | Display the upgrade plugins form. |
wp-admin/update-core.php: list_theme_updates() | Display the upgrade themes form. |
wp-includes/capabilities.php: get_super_admins() | Retrieve a list of super admins. |
wp-includes/capabilities.php: map_meta_cap() | Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked. |
wp-includes/l10n.php: get_locale() | Retrieves the current locale. |
wp-includes/pluggable.php: wp_salt() | Returns a salt to add to hashes. |
wp-includes/class-wp-theme.php: WP_Theme::get_allowed_on_network() | Returns array of stylesheet names of themes allowed on the network. |
wp-includes/functions.php: global_terms_enabled() | Determine whether global terms are enabled. |
wp-includes/default-constants.php: wp_cookie_constants() | Defines cookie-related WordPress constants. |
wp-includes/update.php: wp_version_check() | Check WordPress version against the newest version. |
wp-includes/option.php: set_site_transient() | Sets/updates the value of a site transient. |
wp-includes/option.php: get_site_transient() | Retrieves the value of a site transient. |
wp-includes/user.php: wp_get_user_contact_methods() | Set up the user contact methods. |
wp-includes/ms-functions.php: get_space_allowed() | Returns the upload quota for the current blog. |
wp-includes/ms-functions.php: get_upload_space_available() | Determines if there is any upload space left in the current blog’s quota. |
wp-includes/ms-functions.php: is_upload_space_available() | Determines if there is any upload space left in the current blog’s quota. |
wp-includes/ms-functions.php: upload_size_limit_filter() | Filters the maximum upload file size allowed, in bytes. |
wp-includes/ms-functions.php: users_can_register_signup_filter() | Check whether users can self-register, based on Network settings. |
wp-includes/ms-functions.php: wpmu_welcome_user_notification() | Notify a user that their account activation has been successful. |
wp-includes/ms-functions.php: check_upload_mimes() | Check an array of MIME types against a list of allowed types. |
wp-includes/ms-functions.php: upload_is_file_too_big() | Check whether an upload is too big. |
wp-includes/ms-deprecated.php: install_blog() | Install an empty blog. |
wp-includes/ms-functions.php: newblog_notify_siteadmin() | Notifies the network admin that a new site has been activated. |
wp-includes/ms-functions.php: newuser_notify_siteadmin() | Notifies the network admin that a new user has been activated. |
wp-includes/ms-functions.php: wpmu_welcome_notification() | Notifies the site administrator that their site activation was successful. |
wp-includes/ms-functions.php: is_email_address_unsafe() | Checks an email address against a list of banned domains. |
wp-includes/ms-functions.php: wpmu_validate_user_signup() | Sanitize and validate data required for a user sign-up. |
wp-includes/ms-functions.php: wpmu_validate_blog_signup() | Processes new site registrations. |
wp-includes/ms-functions.php: wpmu_signup_blog_notification() | Send 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. |
wp-includes/ms-functions.php: wpmu_signup_user_notification() | Send 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-includes/ms-load.php: wp_get_active_network_plugins() | Returns array of network plugin files to be included in global scope. |
wp-includes/ms-load.php: ms_site_check() | Checks status of current blog. |
wp-includes/ms-deprecated.php: get_dashboard_blog() | Get the “dashboard blog”, the blog where users without a blog edit their profile data. |
wp-includes/ms-default-constants.php: ms_upload_constants() | Defines Multisite upload constants. |
wp-includes/script-loader.php: script_concat_settings() | Determine 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. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_site_option