edit to #1120947
I have find one more issue.
When a user register from Frontend they get the correct Role (CompanyUser) - thats correct.
But then i cant add this as a Auther. Only administrators can be authors on posts.
Okay please go to Toolset > Access Control > Post Types tab. I'm not sure which post type you are referring to, but check to be sure each post type is Managed by Access, and that CompanyUser role has permission to Publish posts. Right now, I can see that the standard Post type is not managed by Access, so CompanyUsers cannot publish Posts. If I have misunderstood your question, please let me know which post type you are referring to, and tell me the name of a CompanyUser so I can test this in wp-admin. Thank you!
Posttype: Company Offer
I did try that first, and did not solve it.
I have giv standard Post, satndard Page and CustomerUser the acces to Publish.
Still no CustomerUsers in Author field.
Okay I've added some custom code to your child theme:
add_filter( 'wp_dropdown_users_args', 'tssupp_fix_author_dropdown' );
function tssupp_fix_author_dropdown( $query_args ){
global $pagenow;
if (( $pagenow == 'post.php' ) && (get_post_type() == 'post' || get_post_type() == 'page' || get_post_type() == 'company' || get_post_type() == 'offers')) {
// Only modify dropdown users on a post edit screen
$query_args['who'] = '';
$query_args['role__in'] = array( 'administrator', 'editor', 'author', 'companyuser' );
}
return $query_args;
This will enable you to select Users with the CompanyUser role in the author select field for Posts, Pages, Companies, and Company Offers. Let me know if that's not accurate and I'll be glad to make any necessary modifications. Be sure to pull the functions.php file down to your local file repository.