Skip to content

Commit

Permalink
Don't show broken parent post links for orphaned media. fixes #6408
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@7543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
markjaquith committed Mar 27, 2008
1 parent b9fff33 commit f945af8
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions wp-admin/edit-attachment-rows.php
Expand Up @@ -85,16 +85,22 @@
break;

case 'parent':
if ( $post_parent = get_post($post->post_parent) ) {
$title = get_the_title($post->post_parent);
if ( empty($title) )
$title = __('(no title)');
$title = __('(no title)'); // override below
if ( $post->post_parent > 0 ) {
if ( get_post($post->post_parent) ) {
$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 {
$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;

case 'comments':
Expand Down

0 comments on commit f945af8

Please sign in to comment.