Skip Navigation

[Resolved] Product author permission group

This support ticket is created 7 years, 8 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
#448424

I am trying to: Change the author of a product (standard woocommerce product type) to somebody who has registered on the website. I've set up a custom usergroup, which is based off the subscriber type. Customers can fill in a front-end form to create a product, which they will be then set as the author, but when i go to change to another registered user on the site i can only choose it to be another admin / author.

I purposely don't want my custom usergroup to have the 'author' permissions, because this would give them access to wp-admin and some of the dashboard. Is there a role / permission i can set for my custom group which makes them show up in the list of possible authors to change a product to?

I hope that makes sense.

Thanks

#448603

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 in metabox "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_subscriber_author_func', 10, 2);
 function assign_subscriber_author_func($query_args, $r){
    $query_arg['who'] = 'subscriber';
    return $query_arg;
}

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

#448679

Thank you, that worked perfectly 🙂

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