Don't show broken parent post links for orphaned media. fixes #6408

git-svn-id: https://develop.svn.wordpress.org/trunk@7543 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2008-03-27 02:50:01 +00:00
parent 0afce7ab24
commit d1d1904927
1 changed files with 14 additions and 8 deletions

View File

@ -85,16 +85,22 @@ foreach($posts_columns as $column_name=>$column_display_name) {
break; break;
case 'parent': case 'parent':
if ( $post_parent = get_post($post->post_parent) ) { $title = __('(no title)'); // override below
$title = get_the_title($post->post_parent); if ( $post->post_parent > 0 ) {
if ( empty($title) ) if ( get_post($post->post_parent) ) {
$title = __('(no title)'); $parent_title = get_the_title($post->post_parent);
if ( !empty($parent_title) )
$title = $parent_title;
}
?>
<td><strong><a href="post.php?action=edit&amp;post=<?php echo $post->post_parent; ?>"><?php echo $title ?></a></strong></td>
<?php
} else { } else {
$title = ''; ?>
<td>&nbsp;</td>
<?php
} }
?>
<td><strong><a href="post.php?action=edit&amp;post=<?php echo $post->post_parent; ?>"><?php echo $title ?></a></strong></td>
<?php
break; break;
case 'comments': case 'comments':