Skip Navigation

[Resolved] Cannot assign a subscriber as the author of a custom post

This support ticket is created 8 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Darryl 8 years ago.

Assisted by: Luo Yang.

Author
Posts
#381095
Access.png

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.

#381143

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/

#384395

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.