valendesigns / option-tree

Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
GNU General Public License v2.0
598 stars 180 forks source link

ot_recognized_typography_fields filter causes "ot_validate_setting was called incorrectly." #724

Open anteksiler opened 4 years ago

anteksiler commented 4 years ago

Removing any of the fields using the filter:

function thb_filter_typography_fields( $array, $field_id ) {

if ( in_array( $field_id, array(  'primary_font' ), true ) ) {
        $array = array(
            'font-family',
            'font-size',
            'font-style',
            'font-variant',
            'font-weight',
            'letter-spacing',
            'line-height',
        );
    }
    return $array;
}
add_filter( 'ot_recognized_typography_fields', 'thb_filter_typography_fields', 1, 2 );

causes:

Notice: ot_validate_setting was called incorrectly. All stored data must be filtered through ot_validate_setting_input_safe, the typography option type is not using this filter. This is required since version 2.7.0.