WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/20/2014 05:49:30 PM (8 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

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

    r27036 r27209  
    2525$action = isset($action) ? $action : '';
    2626
    27 if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
     27$media_type = false;
     28if ( 'attachment' && $post_ID ) {
     29    $post = get_post( $post_ID );
     30    $media_type = post_supports_thumbnails( $post );
     31}
     32
     33if ( post_type_supports( $post_type, 'editor' ) || post_type_supports( $post_type, 'thumbnail' ) || $media_type ) {
    2834    add_thickbox();
    2935    wp_enqueue_media( array( 'post' => $post_ID ) );
Note: See TracChangeset for help on using the changeset viewer.