WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/07/2010 07:45:57 PM (10 years ago)
Author:
ryan
Message:

Assume current user of user ID is not passed. Props filosofo. fixes #11808

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r12597 r12650  
    100100if ( is_object_in_taxonomy($post_type, 'category') )
    101101    add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', $post_type, 'side', 'core');
    102 if ( current_theme_supports( 'post-thumbnails', $post_type ) )
     102if ( current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports($post_type, 'post-thumbnails') )
    103103    add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', $post_type, 'side', 'low');
    104 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $post_type, 'normal', 'core');
    105 add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', $post_type, 'normal', 'core');
    106 add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', $post_type, 'normal', 'core');
     104if ( post_type_supports($post_type, 'excerpts') )
     105    add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $post_type, 'normal', 'core');
     106if ( post_type_supports($post_type, 'trackbacks') )
     107    add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', $post_type, 'normal', 'core');
     108if ( post_type_supports($post_type, 'custom-fields') )
     109    add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', $post_type, 'normal', 'core');
    107110do_action('dbx_post_advanced');
    108 add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', $post_type, 'normal', 'core');
    109 
    110 if ( 'publish' == $post->post_status || 'private' == $post->post_status )
     111if ( post_type_supports($post_type, 'comments') )
     112    add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', $post_type, 'normal', 'core');
     113
     114if ( ('publish' == $post->post_status || 'private' == $post->post_status) && post_type_supports($post_type, 'comments') )
    111115    add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', $post_type, 'normal', 'core');
    112116
Note: See TracChangeset for help on using the changeset viewer.