mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00:00
Allow registering post image support per post type. fixes #11364
git-svn-id: https://develop.svn.wordpress.org/trunk@12350 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -98,7 +98,7 @@ foreach ( get_object_taxonomies('post') as $tax_name ) {
|
||||
}
|
||||
|
||||
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
|
||||
if ( current_theme_supports( 'post-images' ) )
|
||||
if ( current_theme_supports( 'post-images', 'post' ) )
|
||||
add_meta_box('postimagediv', __('Post Image'), 'post_image_meta_box', 'post', 'side', 'low');
|
||||
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
|
||||
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
@@ -80,7 +80,7 @@ add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'pag
|
||||
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core');
|
||||
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core');
|
||||
add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core');
|
||||
if ( current_theme_supports( 'post-images' ) )
|
||||
if ( current_theme_supports( 'post-images', 'page' ) )
|
||||
add_meta_box('postimagediv', __('Page Image'), 'post_image_meta_box', 'page', 'side', 'low');
|
||||
|
||||
$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
|
||||
|
||||
@@ -1239,7 +1239,7 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
}
|
||||
|
||||
$thumbnail = '';
|
||||
if ( 'image' == $type && current_theme_supports( 'post-images' ) && get_post_image_id($_GET['post_id']) != $attachment_id )
|
||||
if ( 'image' == $type && isset($_GET['post_id']) && current_theme_supports( 'post-images', get_post_type($_GET['post_id']) ) && get_post_image_id($_GET['post_id']) != $attachment_id )
|
||||
$thumbnail = "<a class='wp-post-thumbnail' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as post image" ) . "</a>";
|
||||
|
||||
if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) )
|
||||
|
||||
Reference in New Issue
Block a user