0

I want to give full permission to editor user to access a particular plugin MC4WP: Mailchimp for WordPress https://wordpress.org/plugins/mailchimp-for-wp/

For it added below code in fuctions.php file inside child theme folder

add_filter('mc4wp_admin_required_capability', function($capability) 
{
    return 'edit_pages';
});

Editor can access mailchimp plugin, but if editor user try click save button to save API key in plugin setting then getting error.

You need a higher level of permission. Sorry, you are not allowed to manage options for this site.

I am using Advanced Access Manager plugin https://wordpress.org/plugins/advanced-access-manager/, in plugin setting i have give full permission to editor user for mailchimp plugin, check screenshot.

but not working.

enter image description here

MailChimp for WordPress comes with a range of action and filter hooks - https://github.com/ibericode/mc4wp-snippets/blob/master/hooks.md

0

This is a problem with the original plugin. They obviously never actually tested this filter. They have used the mc4wp_admin_required_capability to control whether the admin page is accessible, but WordPress still prevents you saving settings unless this filter is also used:

https://developer.wordpress.org/reference/hooks/option_page_capability_option_page

You should contact the plugin author and ask them to fix this, but in the meantime you could implement this yourself. Assuming this is the plugin in question, this should work:

add_filter(
    'option_page_capability_mc4wp_settings',
    function( $capability ) {
        return 'edit_pages';
    }
);

You will probably also need this to save the "Integrations" settings.

add_filter(
    'option_page_capability_ mc4wp_integrations_settings',
    function( $capability ) {
        return 'edit_pages';
    }
);

Plugins like "Advanced Access Manager" don't usually help with this, because the only way to know whether these filters are possible is to read the plugin code, which is why plugins like that are pretty useless. All they can see are which admin menus are registered, and which user roles are registered, because they're declared up front. They can't actually control how a plugin uses roles and capabilities without inspecting the code of every plugin and implementing solutions manually.

If it's possible grant full access to a plugin's settings with a plugin like Advanced Access Manager, then the original plugin has not implemented settings in a very secure way.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.