How to add author role as a custom field to custom post type in wordpress?
I want to add a custom field in the wordpress custom post type, such that this field dynamically fetches the value of the author role.
Purpose -
I want to add this custom field so that I can filter custom post types based on the user role of the author of the posts, that is editor, subscriber, etc.
What have I tried?
Well, I looked up the solution on Internet but couldn't find one and I am not that great in PHP so couldn't give it a shot myself.
Kindly suggest a solution.
Thanks a lot, in advance.
Topic user-roles Wordpress
Category Web