Created
August 12, 2012 23:35
Add caps Custom Post Type WordPress
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
<?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