Why doesn’t wp_update_post() update the post_status field?

Answer couldn’t be simpler. As pointed out by Otto at the wp-hackers list, problem was me not setting post_date_gmt when using wp_update_post(). Final code looks like this: if ( $post_date < strtotime( “tomorrow” ) ) { $status=”publish”; $newpostdata[‘post_status’] = $status; $newpostdata[‘post_date’] = date( ‘Y-m-d H:i:s’, $post_date ); // Also pass ‘post_date_gmt’ so that WP plays … Read more

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