'option' * is used for Theme Customizer settings * * @return string DB entry */ function encrypted_lite_option() { return apply_filters( 'encrypted_lite_option', 'encrypted_lite_theme_options' ); } /** * Get Option Values * * Array that holds all of the options values * Option's default value is used if user hasn't specified a value * * @uses thsp_get_theme_customizer_defaults() defined in /customizer/options.php * @return array Current values for all options * @since Theme_Customizer_Boilerplate 1.0 */ function encrypted_lite_get_options_values() { // Get the option defaults $encrypted_option_defaults = encrypted_lite_get_options_defaults(); // Parse the stored options with the defaults $encrypted_lite_options = wp_parse_args( get_option( encrypted_lite_option(), array() ), $encrypted_option_defaults ); // Return the parsed array return $encrypted_lite_options; } /** * Get Option Defaults * * Returns an array that holds default values for all options * * @uses thsp_get_theme_customizer_fields() defined in /customizer/options.php * @return array $encrypted_option_defaults Default values for all options * @since Theme_Customizer_Boilerplate 1.0 */ function encrypted_lite_get_options_defaults() { // Get the array that holds all theme option fields $encrypted_sections = encrypted_lite_get_fields(); // Initialize the array to hold the default values for all theme options $encrypted_option_defaults = array(); // Loop through the option parameters array foreach ( $encrypted_sections as $encrypted_section ) { $encrypted_section_fields = $encrypted_section['fields']; foreach ( $encrypted_section_fields as $encrypted_field_key => $encrypted_field_value ) { // Add an associative array key to the defaults array for each option in the parameters array if( isset( $encrypted_field_value['setting_args']['default'] ) ) { $encrypted_option_defaults[$encrypted_field_key] = $encrypted_field_value['setting_args']['default']; } else { $encrypted_option_defaults[$encrypted_field_key] = false; } } } // Return the defaults array return $encrypted_option_defaults; }