I want to be able to select a subscriber an author of a post in the admin so it displays their name as having written the post, but I do not want to give them any additional privileges (if they login the only thing they can access is their profile).
Is there a simple way to do this without having to change roles and capabilities?
Thanks
This is a simple hack I wrote in a similar situation. It will display all the
Subscribers
in theAuthor
dropdown on edit/add post/page, from where you can select any one you want. I think it should work for you…The trick behind this is, after you submit submit this page, WP only reads the $user->ID from this drop down in the $_POST array, and assigns it as the posts author. And that’s what you want!
As of WordPress 4.4.0 you can now use the
wp_dropdown_users_args
filter. The code is much simpler now:This is similar approach to @brasofilo. But only works in the edit post screen, rather than quick edit, and includes all users (not just authors and subscribers).
This mimics the default author metabox but the call
wp_dropdown_users
omits thewho=>'editors'
argument. It defaults to the only other value which is call users.A better way to do it…
This is a code linked by @Innate in a comment (solution) to his own question, I’ve just adapted a little bit and tested in WP 3.3.2 (function wpse39084).
It will show the subscribers in posts Edit and Quick Edit.
Also added a couple of actions (functions wpse50827) to move the Author meta box inside the Publish Actions meta box, for easier management.
Everything is post related, no pages nor CPTs…
I’ve done something similar to the accepted answer here but only wanted to show admins and in my case, a custom ‘producers’ role, together.
This could be a solution to avoid the error in quick-editing, where “cpt_slug” should be replaced with your custom post type slug