Support

Account

Home Forums Backend Issues (wp-admin) Emojis are removed from ACF text field

Helping

Emojis are removed from ACF text field

  • 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);

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.