Changeset 9041
- Timestamp:
- 09/30/2008 09:32:13 PM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-attachment-rows.php
r9028 r9041 31 31 global $current_user; 32 32 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); 33 $att_title = get_the_title(); 34 if ( empty($att_title) ) 35 $att_title = __('(no title)'); 33 $att_title = _draft_or_post_title(); 36 34 37 35 ?> … … 141 139 142 140 case 'parent': 143 $title = __('(no title)'); // override below144 141 if ( $post->post_parent > 0 ) { 145 142 if ( get_post($post->post_parent) ) { 146 $parent_title = get_the_title($post->post_parent); 147 if ( !empty($parent_title) ) 148 $title = $parent_title; 143 $title =_draft_or_post_title($post->post_parent); 149 144 } 150 145 ?> -
trunk/wp-admin/includes/template.php
r9036 r9041 894 894 return; 895 895 896 $title = apply_filters( 'the_title', $post->post_title ); 897 if ( empty($title) ) 898 $title = __('(no title)'); 896 $title = _draft_or_post_title($post->ID); 899 897 900 898 echo ' … … 966 964 $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); 967 965 $edit_link = get_edit_post_link( $post->ID ); 968 $title = get_the_title(); 969 if ( empty($title) ) 970 $title = __('(no title)'); 966 $title = _draft_or_post_title(); 971 967 ?> 972 968 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status ); ?> iedit' valign="top"> … … 1184 1180 $posts_columns = wp_manage_pages_columns(); 1185 1181 $hidden = (array) get_user_option( 'manage-page-columns-hidden' ); 1186 $title = get_the_title(); 1187 if ( empty($title) ) 1188 $title = __('(no title)'); 1182 $title = _draft_or_post_title(); 1189 1183 ?> 1190 1184 <tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit"> … … 2501 2495 echo "</div></div>\n"; 2502 2496 } 2503 2497 /** 2498 * Get the post title. 2499 * 2500 * The post title is fetched and if it is blank then a default string is returned. 2501 * 2502 * @since 2.7.0 2503 * @param int $id The post id. If not supplied the global $post is used.. 2504 * 2505 */ 2506 function _draft_or_post_title($post_id = 0) 2507 { 2508 $title = get_the_title($post_id); 2509 if ( empty($title) ) 2510 $title = __('(no title)'); 2511 return $title; 2512 } 2504 2513 ?> -
trunk/wp-admin/upload.php
r9032 r9041 321 321 foreach ( $orphans as $post ) { 322 322 $class = 'alternate' == $class ? '' : 'alternate'; 323 $att_title = empty($post->post_title) ? __('(no title)') : wp_specialchars( apply_filters('the_title', $post->post_title) );323 $att_title = wp_specialchars( _draft_or_post_title($post->ID) ); 324 324 ?> 325 325 <tr id='post-<?php echo $post->ID; ?>' class='<?php echo $class; ?>' valign="top">
Note: See TracChangeset
for help on using the changeset viewer.