I'm working on a CPT but I need to have more control over the layout of the post/edit page (post-new.php and post.php). I thought hacking through admin_init would be the best option, but I can't get the script to work at all. Help?
function init_shelf_page() {
if (!current_user_can('edit_shelves') && $_SERVER['PHP_SELF'] == '/wp-admin/post.php') {
if (isset($_GET['post'])) {
$postID = intval($_GET['post']);
$post = get_post($postID);
if ($post->post_type == 'shelf') {
$post_type_object = get_post_type_object($post->post_type);
if (!current_user_can($post_type_object->cap->edit_posts)) {
wp_die(__('Cheatin’ uh?'));
}
include(dirname(__FILE__) . '/shelf-page.php');
die;
}
}
}
}
add_action('admin_init', 'init_shelf_page');