User Capabilities and Permissions — a practical guide to WordPress capabilities with clear examples you can reuse in real projects.
WordPress Plugin Development Series (24/95). Prefer one article? Read the complete WordPress plugin development tutorial.
Short description
Check capabilities before rendering UI and before processing actions. Map custom caps to roles on activation if needed.
Capability check
if (! current_user_can('manage_options')) {
wp_die(esc_html__('You do not have permission.', 'acme-tools'));
}