From 779b8ff3342a0c352378bdbc23f72e4790bb623a Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 22 Oct 2010 20:17:17 +0000 Subject: [PATCH] Default send to editor to true if the post parent is empty. Props blepoxp. fixes #14133 git-svn-id: http://svn.automattic.com/wordpress/trunk@15920 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 85fa7011ed..44a9da8759 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1113,8 +1113,8 @@ function get_media_item( $attachment_id, $args = null ) { $thumb_url = false; $post = get_post( $attachment_id ); - - $default_args = array( 'errors' => null, 'send' => post_type_supports(get_post_type($post->post_parent), 'editor'), 'delete' => true, 'toggle' => true, 'show_title' => true ); + + $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 ); $args = wp_parse_args( $args, $default_args ); extract( $args, EXTR_SKIP );