lukethacoder / wp-webhook-netlify-deploy

🚢 WP Plugin that adds functionality to easily send Netlify Webhook requests
https://wordpress.org/plugins/webhook-netlify-deploy
GNU General Public License v3.0
94 stars 18 forks source link

Fix: The new permission hooks does not work for the "Webhook Deploy" menu and "Developer Settings" submenu #12

Closed kimhornung closed 5 years ago

kimhornung commented 5 years ago

The new permission hooks in v1.1 only work for the WP admin bar, not the regular menu items.

To test the hooks, you can use the example from the README.md file:

add_filter('netlify_status_capability', function() {
    return 'edit_pages';
});

add_filter('netlify_deploy_capability', function() {
    return 'edit_pages';
});

add_filter('netlify_adjust_settings_capability', function() {
    return 'edit_pages';
});

However, if you add the above filters and then log in as an "author" or "editor" user, then you'll only see the "Deploy site" and "Netlify status" buttons in the WP admin bar.

You will not see the "Webhook Deploy" menu, and also not the "Developer Settings" submenu.

This pull request fixes this issue.