mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Allow pseudo post types attachment:audio and attachment:video to get the media modal on Edit Media when they support featured images.
Introduces `post_supports_thumbnails( $post )` and `theme_supports_thumbnails( $post )` to cut down on duplicated code everytime this needs to be checked. There will be more cases forthcoming. See #26631. git-svn-id: https://develop.svn.wordpress.org/trunk@27209 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -24,7 +24,13 @@ $post_ID = isset($post_ID) ? (int) $post_ID : 0;
|
||||
$user_ID = isset($user_ID) ? (int) $user_ID : 0;
|
||||
$action = isset($action) ? $action : '';
|
||||
|
||||
if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
|
||||
$media_type = false;
|
||||
if ( 'attachment' && $post_ID ) {
|
||||
$post = get_post( $post_ID );
|
||||
$media_type = post_supports_thumbnails( $post );
|
||||
}
|
||||
|
||||
if ( post_type_supports( $post_type, 'editor' ) || post_type_supports( $post_type, 'thumbnail' ) || $media_type ) {
|
||||
add_thickbox();
|
||||
wp_enqueue_media( array( 'post' => $post_ID ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user