Amp Form
-
Hello,
i am using contact form 7, and as i saw you convert it to amp-form, and as mentioned here
https://amp-wp.org/documentation/playbooks/handling-form-submissions/
messages depends on $success variable, i execute this code in my funtions.php
===============================================================================
function custom_redirects() {if ( wp_is_json_request() ) {
if ( $success ) {
$message = __( ‘Success! Thanks for your submission.’, ‘my-textdomain’ );
} else {
$message = __( ‘Sorry, your submission is incomplete.’, ‘my-textdomain’ );
}
wp_send_json( compact( ‘message’ ), $success ? 200 : 400 );
}}
add_action( ‘template_redirect’, ‘custom_redirects’ );
===================================================================
but $success always false , so how to get this variable value??
other question validation in contact form not worksThe page I need help with: [log in to see the link]
- The topic ‘Amp Form’ is closed to new replies.