Avoid PHP notices in Media Library if an attachment parent post type no longer exists.

props wpsmith.
fixes #27439.
Built from https://develop.svn.wordpress.org/trunk@27560


git-svn-id: http://core.svn.wordpress.org/trunk@27403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-03-17 15:33:15 +00:00
parent 513b6992e5
commit bfef727df3
1 changed files with 1 additions and 1 deletions

View File

@ -329,7 +329,7 @@ foreach ( $columns as $column_name => $column_display_name ) {
$parent_type = get_post_type_object( $parent->post_type );
?>
<td <?php echo $attributes ?>><strong>
<?php if ( current_user_can( 'edit_post', $post->post_parent ) && $parent_type->show_ui ) { ?>
<?php if ( current_user_can( 'edit_post', $post->post_parent ) && $parent_type && $parent_type->show_ui ) { ?>
<a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
<?php echo $title ?></a><?php
} else {