Change Post Status From Front End

Simply replace wp_delete_post( get_query_var( ‘postid1’), true ); with wp_update_post( array( ‘ID’ => get_query_var( ‘postid1’ ), ‘post_status’ => ‘draft’ ) ); That is assuming that the rest of your logic does already work.

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’] ) ) ) ); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)