@mitfi,
Creates a new capability could be a solution, but maybe this can create problems.
We can try to do it or maybe we can create a filter in order to override this capability.
What do you think?
Dear @carazo,
many thanks for your fast response!
I understand that you consider an additional capability to be tricky in some cases, hence, a filter would indeed be fine.
By the way:
In my functions.php, I tried to use remove_submenu_page(‘tools.php’, ‘acui’) for non-admins without success…
Therefore, in your plug-in‘s function acui_menu(), I changed the capability directly, which is a rather bad solution – but working.
Again, thanks for your kind support!
Best regards
Michael
Little add-On:
I assume, in your file ‘import-users-from-csv-with-meta.php’, you would modify line 172 to something like
add_submenu_page( ‘tools.php’, __( ‘Import and export users and customers’, ‘import-users-from-csv-with-meta’ ), __( ‘Import and export users and customers’, ‘import-users-from-csv-with-meta’ ), apply_filters( ‘acui_capability’, ‘create_users’ ), ‘acui’, ‘acui_options’ );
in order to be able to add a filter and returning a different capability.
Correct?
Best regards
Michael
Yes, this is maybe not the best solution but this is the fastest and it solve your problem.
Creates a new capability surely creates more problems for other users.
I have just included in new version. Update when you see it available.
Dear @carazo,
as you are surely more experienced with WordPress than I am and it is good for me to learn:
What would you consider a better solution (besides allowing to select the related capability directly from the plugin‘s admin page)?
Thanks for you outstanding responsiveness and support!
Kindest regards
Michael
@mitfi,
The best solution surely would be create a new capability.
But yes, the filter is enough.
@carazo,
thx!
In my ’functions.php’, I create a new administrator capability ’manage_acui’ and filter for it thanks to your kind modification.
Now, I can set any role to this capability.
Best regards
Michael
@mitfi,
Thanks to you for using our plugin!