Last active
September 19, 2017 11:24
-
-
Save grantalltodavid/b707a53dc2c1b10f4a9e425721dc23af to your computer and use it in GitHub Desktop.
Sliced Invoices: in wp-admin area, show quotes and invoices only to admin users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sliced_custom_params_admins_only( $opts ) { | |
$opts['map_meta_cap'] = false; | |
$opts['capabilities'] = array( | |
'edit_post' => 'manage_options', | |
'read_post' => 'manage_options', | |
'delete_post' => 'manage_options', | |
'edit_posts' => 'manage_options', | |
'edit_others_posts' => 'manage_options', | |
'delete_posts' => 'manage_options', | |
'publish_posts' => 'manage_options', | |
'read_private_posts' => 'manage_options', | |
); | |
return $opts; | |
} | |
add_filter( 'sliced_invoice_params', 'sliced_custom_params_admins_only' ); | |
add_filter( 'sliced_quote_params', 'sliced_custom_params_admins_only' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment