D
D
Dolvee2021-07-29 16:01:48
WordPress
Dolvee, 2021-07-29 16:01:48

Wordpress contact form error in 2 language /wp-json/contact-form-7/v1/contact-forms/1939/feedback/ 404, how to solve?

I have 2 languages ​​on my site, when I submit a form in the second language I get an error - en/wp-json/contact-form-7/v1/contact-forms/1939/feedback/ 404

Before updating wp and contact-form 7 is fine this script worked

add_action( 'wp_footer', 'my_footer_scripts',100 );
function my_footer_scripts()
{
 ?>
 <script type="text/javascript">
   wpcf7.apiSettings.root = wpcf7.apiSettings.replace("/en","");
 </script>
<?php
}

But now it gives this error

Uncaught TypeError: Cannot read property 'replace' of undefined
    at (index):971


I tried adding it but the form reloads and a random wpcf7443 tag is added in the address How can I solve this?
add_filter( 'wpcf7_load_js', '__return_false' );


Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question