Skip to content

Instantly share code, notes, and snippets.

@grantalltodavid
Last active September 19, 2017 11:24
Show Gist options
  • Save grantalltodavid/b707a53dc2c1b10f4a9e425721dc23af to your computer and use it in GitHub Desktop.
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
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