Make WordPress Core

Changeset 19350


Ignore:
Timestamp:
11/19/2011 04:28:39 AM (13 years ago)
Author:
azaozz
Message:

Show Insert into post button in the media library when the current post supports editor (not the attachment parent), props SergeyBiryukov, fixes #18912

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r19335 r19350  
    10411041
    10421042    $post = get_post( $attachment_id );
    1043 
    1044     $default_args = array( 'errors' => null, 'send' => $post->post_parent ? post_type_supports( get_post_type( $post->post_parent ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
     1043    $current_post_id = !empty( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0;
     1044
     1045    $default_args = array( 'errors' => null, 'send' => $current_post_id ? post_type_supports( get_post_type( $current_post_id ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
    10451046    $args = wp_parse_args( $args, $default_args );
    10461047    $args = apply_filters( 'get_media_item_args', $args );
Note: See TracChangeset for help on using the changeset viewer.