WordPress.org

Make WordPress Core

Ticket #14133: 14133.diff

File 14133.diff, 759 bytes (added by blepoxp, 11 years ago)

If post parent is empty, return true

  • wp-admin/includes/media.php

     
    11621162                $thumb_url = false;
    11631163
    11641164        $post = get_post( $attachment_id );
    1165 
    1166         $default_args = array( 'errors' => null, 'send' => post_type_supports(get_post_type($post->post_parent), 'editor'), 'delete' => true, 'toggle' => true, 'show_title' => true );
     1165       
     1166        $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 );
    11671167        $args = wp_parse_args( $args, $default_args );
    11681168        extract( $args, EXTR_SKIP );
    11691169