Unable to execute Ajax request, status code 400
Unable to execute Ajax request, status code 400
Unable to execute Ajax request, status code 400
edit user input data contact form 7
How to send automatic response after form submission without plugin
WP_Insert_Post creating duplicate posts when logged in
WordPress Ajax form filter | Search by title with ajax form, breaks the other filters
The function wp_insert_post() returns the post ID on success or the value 0 on error. Your PHP function should look like this : function save_enquiry_form_action() { $args = [ // Your postdata… ]; $is_post_inserted = wp_insert_post($args); if( !empty($is_post_inserted) ) { wp_send_json_success([ ‘post_id’ => $is_post_inserted, ‘post_title’ => get_the_title( $is_post_inserted ), ]); } else { wp_send_json_error(); } … Read more
Ajax action has 200 status but response of No response data available for this request
Solved! Just add the vaidation in PHP and simply ECHO error messages: function smail(){ $nome = $_REQUEST[‘nome’]; $cognome = $_REQUEST[‘cognome’]; $email = $_REQUEST[’email’]; $telefono = $_REQUEST[‘telefono’]; $numero = $_REQUEST[‘numero’]; $messaggio= $_REQUEST[‘messaggio’]; $prod_mail = $_REQUEST[‘prod_mail’]; $prodotto = $_REQUEST[‘prodotto’]; $confezione = $_REQUEST[‘confezione’]; $prezzo = $_REQUEST[‘prezzo’]; if($nome === ”) { $nome = “<span style=”color:#8c8c8c;”>Nome non inserito</span>”; }; if($cognome … Read more
How can I adjust my function so the page editor still loads in the backend?
Should wordpress nonce be placed in html form or in javascript file