WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/04/2010 04:58:43 PM (10 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r12584 r12597  
    1414
    1515    $post_type = $post->post_type;
    16     $can_publish = current_user_can("publish_${post_type}s");
     16    $post_type_object = get_post_type_object($post_type);
     17    $type_cap = $post_type_object->capability_type;
     18    $can_publish = current_user_can("publish_${type_cap}s");
    1719?>
    1820<div class="submitbox" id="submitpost">
     
    185187<div id="delete-action">
    186188<?php
    187 if ( current_user_can( "delete_${post_type}", $post->ID ) ) {
     189if ( current_user_can( "delete_${type_cap}", $post->ID ) ) {
    188190    if ( !EMPTY_TRASH_DAYS ) {
    189191        $delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" );
Note: See TracChangeset for help on using the changeset viewer.