Default send to editor to true if the post parent is empty. Props blepoxp. fixes #14133

git-svn-id: https://develop.svn.wordpress.org/trunk@15920 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-10-22 20:17:17 +00:00
parent efdb066697
commit 6f62e4f13c
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 );