I am trying to: assign the authorship of a post that is of a custom type and created by an admin to someone that is a subscriber.
I have Access managing the post (see pic) and the subscriber has rights to Read Own, Edit Own, Delete Own, and Publish.
When I edit the post, the author drop down only shows the two site administrators.
Dear Darryl,
I assume we are talking about the dropdown menu in metabox "Author".
It is produced by wordpress function wp_dropdown_users(), see the source codes of wordpress core file \wp-admin\includes\meta-boxes.php, line 736~747:
function post_author_meta_box($post) {
global $user_ID;
?>
<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label>
<?php
wp_dropdown_users( array(
'who' => 'authors',
'name' => 'post_author_override',
'selected' => empty($post->ID) ? $user_ID : $post->post_author,
'include_selected' => true
) );
}
the parameter "who" is set as "authors", it is setup as only display the users who has "authors" user role.
And there is a workaround, you can use wordpress filter hook to change it, for example, add below codes into your theme/functions.php:
add_filter('wp_dropdown_users_args', 'assign_subscriber_author_func', 10, 2);
function assign_subscriber_author_func($query_args, $r){
$query_arg['who'] = 'subscriber';
return $query_arg;
}
More help:
https://developer.wordpress.org/reference/functions/post_author_meta_box/
This totally did the trick for me.
Being able to do this through CRED would be very nice, but your solution get's me through what I need.