202 | | if ( post_type_supports($post_type, 'page-attributes') ) |
203 | | add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); |
| 202 | if ( post_type_supports( $post_type, 'page-attributes' ) ) { |
| 203 | add_meta_box( 'pageparentdiv', 'page' == $post_type ? __( 'Page Attributes' ) : __( 'Attributes' ), 'page_attributes_meta_box', null, 'side', 'core' ); |
| 204 | } |
205 | | if ( $thumbnail_support && current_user_can( 'upload_files' ) ) |
206 | | add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low'); |
| 206 | if ( $thumbnail_support && current_user_can( 'upload_files' ) ) { |
| 207 | add_meta_box( 'postimagediv', __( 'Featured Image' ), 'post_thumbnail_meta_box', null, 'side', 'low' ); |
| 208 | } |
208 | | if ( post_type_supports($post_type, 'excerpt') ) |
209 | | add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core'); |
| 210 | if ( post_type_supports( $post_type, 'excerpt' ) ) { |
| 211 | add_meta_box( 'postexcerpt', __( 'Excerpt' ), 'post_excerpt_meta_box', null, 'normal', 'core' ); |
| 212 | } |
211 | | if ( post_type_supports($post_type, 'trackbacks') ) |
212 | | add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core'); |
| 214 | if ( post_type_supports( $post_type, 'trackbacks' ) ) { |
| 215 | add_meta_box( 'trackbacksdiv', __( 'Send Trackbacks' ), 'post_trackback_meta_box', null, 'normal', 'core' ); |
| 216 | } |
214 | | if ( post_type_supports($post_type, 'custom-fields') ) |
215 | | add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core'); |
| 218 | if ( post_type_supports( $post_type, 'custom-fields' ) ) { |
| 219 | add_meta_box( 'postcustom', __( 'Custom Fields' ), 'post_custom_meta_box', null, 'normal', 'core' ); |
| 220 | } |
227 | | if ( post_type_supports($post_type, 'comments') ) |
228 | | add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core'); |
| 232 | if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) { |
| 233 | add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core' ); |
| 234 | } |
230 | | if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') ) |
231 | | add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core'); |
| 236 | if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) ) { |
| 237 | add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core' ); |
| 238 | } |
233 | | if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) |
234 | | add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core'); |
| 240 | if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) { |
| 241 | add_meta_box( 'slugdiv', __( 'Slug' ), 'post_slug_meta_box', null, 'normal', 'core' ); |
| 242 | } |
236 | | if ( post_type_supports($post_type, 'author') ) { |
237 | | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) |
238 | | add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core'); |
| 244 | if ( post_type_supports( $post_type, 'author' ) ) { |
| 245 | if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) { |
| 246 | add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core' ); |
| 247 | } |