Skip to content

Instantly share code, notes, and snippets.

@tcelestino
Created August 12, 2012 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcelestino/3335352 to your computer and use it in GitHub Desktop.
Save tcelestino/3335352 to your computer and use it in GitHub Desktop.
Add caps Custom Post Type WordPress
<?php add_action( 'admin_init', 'cpt_add_caps');
function cpt_add_caps(){
$admin_role = get_role( 'administrator' );
$caps = array(
'publish_cpt',
'edit_cpt',
'edit_others_cpt',
'delete_estacionamentos',
'delete_others_cpt',
'read_private_cpt',
'edit_cpt',
'delete_cpt',
'read_cpt'
);
foreach( $caps as $cap ){
$admin_role->add_cap( $cap );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment