Theme Default settings not saving
-
I want to set the Default values in my theme for the different fonts.
After investigating very much and thanks to the help Sunny provided I came up with:function aaa_egf_default_controls($options) { // Here's how to remove some default controls unset($options['tt_default_body']); unset($options['tt_default_heading_1']); unset($options['tt_default_heading_2']); unset($options['tt_default_heading_3']); unset($options['tt_default_heading_4']); unset($options['tt_default_heading_5']); unset($options['tt_default_heading_6']); $options['post_text_full'] = array( 'name' => 'post_text_full', 'title' => __('Post content', 'easy-google-fonts'), 'description' => __("Edit Font", 'easy-google-fonts'), 'tab' => 'full',// I created a section for this 'properties' => array( 'selector' => 'body', ), 'default' => array( 'subset' => 'latin,all', 'font_id' => 'roboto', 'font_name' => 'Roboto', 'font_color' => '#333333', 'font_weight' => '300', 'font_style' => '', // 'font_weight_style' => '', 'background_color' => '', 'stylesheet_url' => 'https://fonts.googleapis.com/css?family=Roboto', // 'text_decoration' => '', 'text_transform' => 'none', 'line_height' => '1.4', 'font_size' => array( 'amount' => '15', 'unit' => 'px', ), ), ); return $options; } add_filter('tt_font_get_option_parameters', 'aaa_egf_default_controls');
I realized although this set the theme default value, when returning values, most of them were empty. So after searching within the files of the plugin I found out
validate_settings() function has a $whitelist array that removes the mentioned values.How can I overpass this array from outside of the plugin so my Default values dont dissapear?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Theme Default settings not saving’ is closed to new replies.