Don't create an edit link to a non-UI post type in the media list table.

props johnbillion.
fixes #20453.


git-svn-id: https://develop.svn.wordpress.org/trunk@25140 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-08-27 20:48:40 +00:00
parent c637de7316
commit 65465e9c88
1 changed files with 8 additions and 2 deletions

View File

@ -301,11 +301,17 @@ foreach ( $columns as $column_name => $column_display_name ) {
break;
case 'parent':
if ( $post->post_parent > 0 && get_post( $post->post_parent ) ) {
if ( $post->post_parent > 0 )
$parent = get_post( $post->post_parent );
else
$parent = false;
if ( $parent ) {
$title = _draft_or_post_title( $post->post_parent );
$parent_type = get_post_type_object( $parent->post_type );
?>
<td <?php echo $attributes ?>><strong>
<?php if ( current_user_can( 'edit_post', $post->post_parent ) ) { ?>
<?php if ( current_user_can( 'edit_post', $post->post_parent ) && $parent_type->show_ui ) { ?>
<a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
<?php echo $title ?></a><?php
} else {