So I’ve been trying to create a very simple (probably not the best) function that removes the current user from a co-authors list, but I can’t seem to get it to work and I don’t understand why. Both the get_by_user_id and set_post_authors function end up in an error, why is that the case?
`function removeID(){
$id = isset($_GET[‘ID’]) ? $_GET[‘ID’] : ”;
$coauthors = get_multiple_authors($id);
$current = get_by_user_id(get_current_user_id());
$key = array_search($current_user,$coauthors);
unset($coauthors[$key]);
set_post_authors($id,$coauthors);
}