Created
May 22, 2024 08:00
-
-
Save Crocoblock/7be0dbdb31b965c5036c2ec0a20b70c6 to your computer and use it in GitHub Desktop.
JetEngine unslash values before storing a CCT item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'jet-engine/custom-content-types/update-item/sanitize-field-value', function( $value, $field_name, $field ) { | |
if ( ! is_string( $value ) ) { | |
return $value; | |
} | |
if ( empty( $field['type'] ) || ! in_array( $field['type'], array( 'text', 'textarea' ) ) ) { | |
return $value; | |
} | |
return wp_unslash( $value ); | |
}, 0, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment