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
This commit is contained in:
ryan 2010-10-22 20:17:17 +00:00
parent e1a7cc966f
commit 779b8ff334
1 changed files with 2 additions and 2 deletions

View File

@ -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 );