Skip to content

Commit

Permalink
Use correct capability for alternate version menus
Browse files Browse the repository at this point in the history
Fixes #12.
  • Loading branch information
Mike Burns committed Dec 20, 2014
1 parent 22697e9 commit fecd300
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bu-versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ function admin_menu() {
foreach( $v_type_managers as $type => $manager ) {
$original_post_type = $manager->get_orig_post_type();
$post_type_obj = get_post_type_object( $type );
$capability = $post_type_obj->cap->edit_posts;
if( $original_post_type === 'post' ) {
add_submenu_page( 'edit.php', null, $post_type_obj->labels->name, 'edit_pages', 'edit.php?post_type=' . $type);
add_submenu_page( 'edit.php', null, $post_type_obj->labels->name, $capability, 'edit.php?post_type=' . $type);
} else {
add_submenu_page( 'edit.php?post_type=' . $original_post_type, null, $post_type_obj->labels->name, 'edit_pages', 'edit.php?post_type=' . $type);
add_submenu_page( 'edit.php?post_type=' . $original_post_type, null, $post_type_obj->labels->name, $capability, 'edit.php?post_type=' . $type);
}
}
add_submenu_page(null, null, null, 'read', 'bu_create_version', array('BU_Version_Controller', 'create_version_view'));
Expand Down

0 comments on commit fecd300

Please sign in to comment.