diff --git a/wp-admin/includes/class-wp-media-list-table.php b/wp-admin/includes/class-wp-media-list-table.php index d2d013d88a..273fe09f7a 100644 --- a/wp-admin/includes/class-wp-media-list-table.php +++ b/wp-admin/includes/class-wp-media-list-table.php @@ -481,7 +481,7 @@ class WP_Media_List_Table extends WP_List_Table { ?> <strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"> <?php echo $title ?></a></strong><?php - } elseif ( current_user_can( 'read_post', $post->post_parent ) ) { + } elseif ( $parent_type && current_user_can( 'read_post', $post->post_parent ) ) { ?> <strong><?php echo $title ?></strong><?php } else { diff --git a/wp-includes/media.php b/wp-includes/media.php index 00cde91a57..e9e5a291f0 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -3062,11 +3062,12 @@ function wp_prepare_attachment_for_js( $attachment ) { if ( $post_parent ) { $parent_type = get_post_type_object( $post_parent->post_type ); + if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $attachment->post_parent ) ) { $response['uploadedToLink'] = get_edit_post_link( $attachment->post_parent, 'raw' ); } - if ( current_user_can( 'read_post', $attachment->post_parent ) ) { + if ( $parent_type && current_user_can( 'read_post', $attachment->post_parent ) ) { $response['uploadedToTitle'] = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 832e86482a..7cdee33b69 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta1-37951'; +$wp_version = '4.6-beta1-37952'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.