Your use of the init
hook means that the cap is set on every page load.
A better approach is to write a small plugin and set the cap once by using the plugin activation hook. And remove it using the deactivation hook.
Your use of the init
hook means that the cap is set on every page load.
A better approach is to write a small plugin and set the cap once by using the plugin activation hook. And remove it using the deactivation hook.