Title: Custom Type safe string validation for version 2.7
Last modified: May 21, 2019

---

# Custom Type safe string validation for version 2.7

 *  [Agile Logix](https://wordpress.org/support/users/agilelogix/)
 * (@agilelogix)
 * [7 years ago](https://wordpress.org/support/topic/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
    -  This topic was modified 7 years ago by [Agile Logix](https://wordpress.org/support/users/agilelogix/).

The topic ‘Custom Type safe string validation for version 2.7’ is closed to new 
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/option-tree_363534.svg)
 * [OptionTree](https://wordpress.org/plugins/option-tree/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/option-tree/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/option-tree/)
 * [Active Topics](https://wordpress.org/support/plugin/option-tree/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/option-tree/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/option-tree/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Agile Logix](https://wordpress.org/support/users/agilelogix/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/custom-type-safe-string-validation-for-version-2-7/)
 * Status: not resolved