Can multiple authors be assigned on a single custom post?
I have custom post types that I would like to make editable by several users. I created one custom post type using the Toolset plugin. wp_update_post
only allows us to set single author:
$user_id = array();
$userIds = get_field("agency_to_author",$_POST['post_ID']); // Get Multiple User assing using acf field.
foreach ($userIds as $key = $value) {
$user_id[] = $value['ID'];
}
if(!empty($user_id)){
$arg = array(
'ID' = $_POST['post_ID'],
'post_author' = $user_id,
);
wp_update_post( $arg );
}
Topic multi-author author custom-post-types Wordpress
Category Web