1. Go to this page and download the library: Download alleyinteractive/wp-caper library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Alley\WP\Caper;
Caper::grant_to( 'author' )
->caps_for( 'page' )
->except( 'delete_posts' ); // Pass "generic" keys; the actual capability names will be determined automatically.
Caper::deny_to( 'editor' )
->caps_for( 'category' )
->except( 'assign_terms' ); // Pass "generic" keys; the actual capability names will be determined automatically.
use Alley\WP\Caper;
Caper::deny_to( 'editor' )
->caps_for( 'category' )
->only( 'delete_terms' );
Caper::grant_to( 'author' )
->only( 'create_posts' ) // `only()` and `except()` can occur in either order.
->caps_for( 'page' );