How to update all posts but the current one (post__not_in not working?)

There’s a more elegant way of updating your posts using the global $wpdb. function rsc_unpublish_all_ads( $post_id, $post, $update ) { // select all ads other than the current one $args = array( ‘nopaging’ => true, ‘post__not_in’ => array($post_id), ‘post_type’ => ‘rsc-ads’, ‘post_status’ => ‘publish’, ‘fields’=>’ids’ ); $query = new WP_Query($args); $published_ads = $query->posts;//array of post … Read more

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