WordPress front-end post form and email after

Put this after your if empty $errors and edit to meet your needs: if(empty($errors)) { $subject = __(‘[Your Subject]’, ‘your_text_domain’).’ ‘.$title; $body = __(“Name: “,”your_text_domain”).$booking_name; $body .= __(“\n\nEmail: “,”your_text_domain”).$booking_email; $body .= __(“\n\nPhone: “,”your_text_domain”).$booking_phone; $body .= __(“\n\nMessage: “,”your_text_domain”).$message; $headers = __(‘From: [email protected] ‘, ‘your_text_domain’).’ <‘.$booking_email.’>’ . “\r\n” . __(‘Reply-To: ‘,’your_text_domain’) . $email; // Change this $email … Read more

wp_update_post via ajax from frontend

You can stop post revisions using define(‘WP_POST_REVISIONS’, false); in wp-config.php or try below if it works. function save_page() { exit( wp_update_post( array( ‘ID’ => absint( esc_attr( $_POST[‘postID’] ) ), ‘post_type’ =>’your post type’ ‘post_content’ => esc_attr( $_POST[‘content’] ) ) ) ); }

Adding an image to a non existing post

I am not sure this answers your question directly, but as technical trivia — WordPress actually creates a posts as soon as you open editor, with auto-draft status. This is being used precisely to have a target for things like attachments and custom field before it is actually saved by user. So when user “saves” … Read more