Custom Type safe string validation for version 2.7
-
Hi Derek, thank you for your great plugin, I’m using it in one of my plugin, but with the version 2.7, I’ve a problem with my custom type icon-picker, it shows this error.
Notice: ot_validate_setting was called incorrectly. All stored data must be filtered through ot_validate_setting_input_safe, the icon-picker option type is not using this filter. This is required since version 2.7.0.
I just checked you are validation in ot_validate_setting function but with my custom type I don’t see a method to apply the validation without modifying OT itself, can you please suggest a solution for it.
Icon-Picker code for the custom type
if ( ! function_exists( 'ot_type_icon_picker' ) ) { function ot_type_icon_picker( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; $is_readonly = false; /* format setting outer wrapper */ echo '<div class="format-setting type-date-picker ' . ( $has_desc ? 'has-desc' : 'no-desc' ) . ' p-tl-cont">'; /* ICON picker JS */ echo '<script>jQuery(document).ready(function($) { $("#' . esc_attr( $field_id ) . '").iconpicker(); });</script>'; /* description */ echo $has_desc ? '<div class="description">' . htmlspecialchars_decode( $field_desc ) . '</div>' : ''; /* format setting inner wrapper */ echo '<div class="input-group format-setting-inner">'; /* build date picker */ echo '<input id="ptl-fav-icon" type="text" data-placement="bottomRight" class="form-control icp icp-auto" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_id ) . '" value="' . esc_attr( $field_value ) . '" class="widefat option-tree-ui-input ' . esc_attr( $field_class ) . '"' . ( $is_readonly == true ? ' readonly' : '' ) . ' />'; echo '<span class="input-group-addon"></span>'; echo '</div>'; echo '</div>'; } }
Thank you
- The topic ‘Custom Type safe string validation for version 2.7’ is closed to new replies.