Introduce _draft_or_post_title() instead of lots of duplicated (no title) code. Fixes #7801.
git-svn-id: http://svn.automattic.com/wordpress/trunk@9041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -30,9 +30,7 @@ while (have_posts()) : the_post();
|
||||
$class = 'alternate' == $class ? '' : 'alternate';
|
||||
global $current_user;
|
||||
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
||||
$att_title = get_the_title();
|
||||
if ( empty($att_title) )
|
||||
$att_title = __('(no title)');
|
||||
$att_title = _draft_or_post_title();
|
||||
|
||||
?>
|
||||
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
|
||||
@@ -140,12 +138,9 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
break;
|
||||
|
||||
case 'parent':
|
||||
$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;
|
||||
$title =_draft_or_post_title($post->post_parent);
|
||||
}
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong>, <?php echo get_the_time(__('Y/m/d')); ?></td>
|
||||
|
||||
Reference in New Issue
Block a user