More custom post type support. Props scribu. see #9674

git-svn-id: https://develop.svn.wordpress.org/trunk@12597 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-01-04 16:58:43 +00:00
parent 170b14f97d
commit 9ef2cb198f
20 changed files with 292 additions and 102 deletions

View File

@@ -13,7 +13,9 @@ function post_submit_meta_box($post) {
global $action;
$post_type = $post->post_type;
$can_publish = current_user_can("publish_${post_type}s");
$post_type_object = get_post_type_object($post_type);
$type_cap = $post_type_object->capability_type;
$can_publish = current_user_can("publish_${type_cap}s");
?>
<div class="submitbox" id="submitpost">
@@ -184,7 +186,7 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
<?php do_action('post_submitbox_start'); ?>
<div id="delete-action">
<?php
if ( current_user_can( "delete_${post_type}", $post->ID ) ) {
if ( current_user_can( "delete_${type_cap}", $post->ID ) ) {
if ( !EMPTY_TRASH_DAYS ) {
$delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" );
$delete_text = __('Delete Permanently');