/user_capability
This filter is called everytime an action verifies the user role/capability. User role/capability check is done in order to authorize certain users to access and act on plugin data (like editing/deleting/importing).
Argument | Type | Description |
$capability | string | Default user capability manage_options |
[pastacode lang=”php” manual=”function%20prefix_set_user_capability(%20%24capability%20)%20%7B%0A%09%0A%09%2F%2F%20Allow%20Editors%20to%20manage%20the%20plugin.%0A%09if%20(%20current_user_can(%20’editor’%20)%20)%20%7B%0A%09%09%24capability%20%3D%20’editor’%3B%0A%09%7D%20%0A%0A%09return%20%24capability%3B%0A%09%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Fuser_capability’%2C%20’prefix_set_user_capability’%2C%2010%2C%201%20)%3B” message=”” highlight=”” provider=”manual”/]