wp_insert_post not updating custom taxonomy selected if logged in as a subscriber
It’s because within wp_insert_post current user capabilities are checked before adding the terms: if ( current_user_can($taxonomy_obj->cap->assign_terms) ) wp_set_post_terms( $post_ID, $tags, $taxonomy ); to get around this, use wp_set_object_terms instead after wp_insert_post to add the terms: $new_post = array( ‘post_title’ => $postTitle, ‘post_content’ => $post, ‘post_status’ => ‘publish’, ‘post_date’ => date(‘Y-m-d H:i:s’), ‘post_author’ => $user_ID, ‘post_type’ … Read more