Skip Navigation

[Resolved] Assign normal user as author of a custom post

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to Assign normal user as author of a custom post

Solution:
To assign the normal user as the author of the post you need to customize the post author meta box.

You can find the proposed solution with reply here

Relevant Documentation:
https://developer.wordpress.org/reference/functions/post_author_meta_box/

This support ticket is created 7 years, 4 months 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Author
Posts
#550497
e1f6fb2e-a162-49a6-a811-d63c8e16468a.png
65094bc7-570d-4531-9ed4-b9892b02973c.png
3ff84494-fdc1-4df3-96f0-f154512a2bb1.png

I am using getawesomesupport.com as a ticket system. This plugin creates user roles such as: 'Support agent' and 'Support user'. With Toolset I created a CPT where I want to choose a 'support user' as the author. So I set this up while creating the CPT (see screenshot).

For your information: I wil use this CPT to add spend hours on work. With the solution on https://toolset.com/forums/topic/how-to-get-sum-of-custom-field/ I want to give a cumulate view of spend ours for a specific 'support user'. Thats why I want to assign a support user to my CPT.

When writing a new post for this CPT I expect to choose all (10) users. Instead I only see 3 'Support agent'. Probaly because 'Support users' have the same rights as users and 'Support agent' as writers and therefore are not in my author selectbox..

I suppose I can use Access to set the authorisations so I can also choose the support users as author. How can I do this? I know I have to give support users some authorisations to edit/create posts, but I will take care they only have access to the frontend.

Thanks!

#550618

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I assume we are talking about the dropdown menu of post author "Author".

Could you please try to add following code to your current theme's functions.php file and try to resolve your issue.

add_filter('wp_dropdown_users_args', 'assign_any_author_func', 10, 2);
 function assign_subscriber_author_func($query_args, $r){
     $query_arg['who'] = 'any';
    return $query_arg;
}

This will dispaly 'any' (all) user with author dropdown. However - you can change the 'any' value as per your requirement. For more info on that please visit following link:

More info:
https://developer.wordpress.org/reference/functions/post_author_meta_box/

#550655

Great! Exactly what i needed. Thanks for your support.