WordPress.org

Make WordPress Core

Ticket #18912: 18912.2.patch

File 18912.2.patch, 922 bytes (added by SergeyBiryukov, 6 years ago)
  • wp-admin/includes/media.php

     
    10351035                $thumb_url = false; 
    10361036 
    10371037        $post = get_post( $attachment_id ); 
     1038        $current_post_id = !empty( $_GET['post_id'] ) ? (int) $_GET['post_id'] : 0; 
    10381039 
    1039         $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 ); 
     1040        $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 ); 
    10401041        $args = wp_parse_args( $args, $default_args ); 
    10411042        $args = apply_filters( 'get_media_item_args', $args ); 
    10421043        extract( $args, EXTR_SKIP );