Astra_Admin_Helper::get_admin_settings_option( string $key, boolean $network = false, mixed $default = false )
Returns an option from the database for the admin settings page.
Description
Parameters
- $key
-
(string) (Required) The option key.
- $network
-
(boolean) (Optional) Whether to allow the network admin setting to be overridden on subsites.
Default value: false
- $default
-
(mixed) (Optional) Default value to be passed to get_option|get_site_option functions.
Default value: false
Return
(string) Return the option value
Source
File: classes/class-astra-admin-helper.php
public static function get_admin_settings_option( $key, $network = false, $default = false ) {
// Get the site-wide option if we're in the network admin.
if ( $network && is_multisite() ) {
$value = get_site_option( $key, $default );
} else {
$value = get_option( $key, $default );
}
return $value;
}
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.5.1 | Added $default parameter which can be passed to get_option|get_site_option functions. |
1.0.0 | Introduced. |