Example Sanitization
array(
'id' => 'example-text',
'type' => 'text',
'title' => 'Example Text',
'sanitize' => 'wpsf_sanitize_replace_a_to_b',
),
In this example, we will have a function that replaces all letter ‘a’ with letter ‘b’.
if ( ! function_exists( 'wpsf_sanitize_replace_a_to_b' ) ){
function wpsf_sanitize_replace_a_to_b( $value ){
return str_replace( 'a', 'b', $value );
}
}