Support » Plugin: Contact Form 7 » Fail on use accents in wpcf7_form_tag_data_option filter

  • Resolved brunonar

    (@brunonar)


    I’m using the ‘wpcf7_form_tag_data_option’ (a great filter, btw!) with the following codes:
    For the form: <label Select: [select* menu-178 include_blank data:my.unique.id]</label>

    add_filter( 'wpcf7_form_tag_data_option', 'uniqueid_wpcf7_categorias', 10, 3 );
    function uniqueid_wpcf7_categorias( $null, $options, $args  ) {
        if (in_array('my.unique.id',$options)) {
            return array("Baba", "Pedreiro", 'Mecanico');
        }
        return $null;
    }

    Everything works fine, but when I change the code:
    return array("Baba", "Pedreiro", 'Mecanico');
    for this code:
    return array("Babá", "Pedreiro", 'Mecânico');,
    the result only shows the “Pedreiro” option.

    I tested a direct input of Babá and Mecânico (like bellow) and it worked out.
    <label Select: [select* menu-178 include_blank "Babá" "Pedreiro" "Mecânico"]</label>

    How could I solve it?

    Thanks in advance.

    • This topic was modified 2 years ago by  brunonar.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    I just tested your code on my testing environment and it worked. It correctly rendered the three Babá, Pedreiro, and Mecânico options. I don’t have any idea why the issue is seen on your side.

    BTW, the opening <label> doesn’t have >. I don’t think it’s relevant to the issue, though.

    joybuc

    (@joybuc)

    Hi, I am using wpcf7 with great results until now.
    No idea why, but for some time a have the following error on the bottom of every webpage where contact form 7 was inserted:
    Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.
    Apache Server at box899.temp.domains Port 80
    _1403″ name=”cf7ct_security_token” id=”cf7ct_security_token”>
    Could you please help on how can I resolve this issue?
    I use contact form 7 custom skin.
    I know this is not the topic but i hope you will still be so nice and give a hand

    Thanks a lot

    brunonar

    (@brunonar)

    Takayuki, thank you very much for your quicky response!
    I figure out what was happening. My problem was the file’s codification. My bad.
    Again, thank you very much.

    joybuc, could you paste the shortcode that your are using on the posts? Try to create a new post with all useful information that you can provide in order to help us to help you to solve this problem.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fail on use accents in wpcf7_form_tag_data_option filter’ is closed to new replies.