Created
October 7, 2016 03:16
-
-
Save anilmeena/0e6bc68563f5f0234fdcb870f7e62471 to your computer and use it in GitHub Desktop.
Add Capabilities for Custom Post type
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 Capabilities for Custom Post type | |
add_action( 'init', 'create_my_post_types' ); | |
function create_my_post_types() { | |
register_post_type( | |
'movie', | |
array( | |
'public' => true, | |
'capability_type' => 'movie', | |
'capabilities' => array( | |
'publish_posts' => 'publish_movies', | |
'edit_posts' => 'edit_movies', | |
'edit_others_posts' => 'edit_others_movies', | |
'read_private_posts' => 'read_private_movies', | |
'edit_post' => 'edit_movie', | |
'delete_post' => 'delete_movie', | |
'read_post' => 'read_movie', | |
), | |
) | |
); | |
} | |
// Then add all these capabilities from User Role Editor Plugins setting page. | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment