Hi,
I created an ACF field to save text with emojis. But when I update the post with text and emoji, the changes are not saved.
What code should I add on functions.php to urlencode() the emojis (on this specific field only) on the database ?
Regards,
Vianney
I tried this code, but it’s not working, do you know why by any chance ?
function my_acf_save_post( $post_id ) {
if( isset($_POST[‘acf’][‘card_lancement_texte’]) ) {
$_POST[‘acf’][‘card_lancement_texte’] = urlencode($_POST[‘acf’][‘card_lancement_texte’]);
}
return $_POST[‘acf’][‘card_lancement_texte’];
}
add_action(‘acf/save_post’, ‘my_acf_save_post’, 5);