astra_get_options()
Retrieve Astra theme options array.
Description
Return
(array) The theme options array.
Source
File: classes/astra-common-functions.php
function astra_get_options() { // Ensure we're not interfering during WordPress installation. if ( wp_installing() ) { return array(); } /** * Filter to bypass the cached Astra options. * * Example usage: * add_filter( 'astra_get_options_nocache', '__return_true' ); * * @since 4.8.9 * @return bool Whether to bypass the cache. Default is false. */ if ( apply_filters( 'astra_get_options_nocache', false ) ) { $astra_options = get_option( ASTRA_THEME_SETTINGS ); } else { // Use a static variable to cache the options for this request. static $cached_astra_options = null; // Fetch the options once and cache them in the static variable. if ( is_null( $cached_astra_options ) || is_customize_preview() ) { $cached_astra_options = is_callable( 'Astra_Theme_Options::get_astra_options' ) ? Astra_Theme_Options::get_astra_options() : get_option( ASTRA_THEME_SETTINGS ); } $astra_options = $cached_astra_options; } /** * Filter the options array for Astra Settings. * * @since 4.8.9 * @return array The theme options array. */ return apply_filters( 'astra_get_options', $astra_options ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
4.8.9 | Introduced. |