I have an issue when the Author dropdown (on Admin -> post edit page) is not available when the Toolset Access plugin is activated. Screenshot is attached
- I have multiple admins and other user roles
- I have some access limits set up in Toolset Access to other user roles but not to admins. So I should be able to see at least admin in the Author dropdown.
- I use the Astra theme. When I change the theme to the Twenty Twenty one, nothing changes.
- other plugins deactivation doesn't make any difference.
Not sure if it's a bug or I did something wrong. I would be happy to hear your advice.
Hello and thank you for contacting Toolset support.
Does this happen to regular post types(Posts and Pages) or to a custom post type defined by Toolset(or another plugin)?
If it is happening to custom post types, edit the post type in Toolset->Post Types, and add the author option to it. Check this screenshot hidden link
This should be enough to get admins, editor, and authors(default WordPress roles) to appear in the authors' dropdown.
If you need to display custom roles(from Toolset Access or somewhere else), you'll need to add custom code to change the roles of the users that can be made authors. Check an example here https://toolset.com/forums/topic/cant-add-new-user-with-new-custom-role-as-author/
And here hidden link
I hope this helps. Let me know if you have any questions.
Hi Jamal. Thank you for your reply.
The issue happens with all custom post types (all defined by Toolset and all of them have "author" field activated) and pages. For some reason, regular posts' authors can be changed.
Thank you for letting me know how to display custom roles. I would need that a well so I will check pages you've shared.
Awesome. Let me know if you need further assistance. At this point, I'll set this ticket as waiting for your reply which should keep it open for a couple of weeks. You will receive reminders notifications before it gets closed.
Hi Jamal. I've tried the solution with a code snippet from this link https://toolset.com/forums/topic/cant-add-new-user-with-new-custom-role-as-author/ and it worked in terms of adding a custom role to the authors dropdown. However, I keep facing the issue but with some updates after adding the snippet:
now author dropdowns are available BUT dropdowns give options of all custom role users and only one admin ( I have more admin users).
I checked Toolset Access settings for admins just in case but everything is marked, so basically, there are no limitations for admins..
additionally (in case it matters), when I delete any user I can attribute all content only to users with a custom role.
What if you update the code to include the administrators too? Something like:
function wpdocs_add_members_to_dropdown( $query_args, $r ) {
$query_args['role'] = array('member', 'administrator');
// Unset the 'who' as this defaults to the 'author' role
unset( $query_args['who'] );
return $query_args;
}
add_filter( 'wp_dropdown_users_args', 'wpdocs_add_members_to_dropdown', 10, 2 );
If it does not help, we should first exclude any possible compatibility issues. Please check if these issues appear when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty-Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.
Hi Jamal. Thank you. I've tried the updated code you've sent me and it made the dropdown disabled like it was before. So I returned your code snippet previous version.
I tried to disable all plugins except Toolset as well as I tried Twenty Twenty one theme - same issue, no difference. But as soon as I deactivate the Toolset Access plugin everything comes back to normal.
Jamal, I tried to use 'role__in' instead of "role" in your snippet which includes "administrator" and it worked for me.
$query_args['role__in'] = array('member', 'administrator');
Now I can chose administrators in author dropdowns as well as attribute content to them when delete user.
Awesome. I am glad you get it fixed. And thank you for sharing the fix that you implemented.