Hi @acarvalheiro, thanks for getting in touch.
All the authors in our plugin are stored as taxonomy terms of “author” taxonomy.
More details here: https://publishpress.com/knowledge-base/authors-data-backup/
So basically you need to use the meta query for filtering according to your requirements:
https://developer.ww.wp.xz.cn/reference/classes/wp_query/#custom-field-post-meta-parameters
For easily removing an author of a post, there is no UI in the frontend yet. But you could use the method “MultipleAuthors\Classes\Utils::set_post_authors”. The method signature is:
/**
* Set the authors for a post
*
* @param int $postId ID for the post to modify.
* @param array $authors Bylines to set on the post.
* @param bool $syncPostAuthor
* @param int $fallbackUserId User ID for using as the author in case no author or if only guests are selected
*/
public static function set_post_authors($postId, $authors, $syncPostAuthor = true, $fallbackUserId = null);
I hope that helps. Feel free to email us at [email protected] if you have more questions.
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);
}
after some debugging wordpress says that the two functions mentioned above are undefined and I cant see why, are they private in any way? How do I call them?