Ticket #5607: remove_admin_notices7.diff
File remove_admin_notices7.diff, 4.0 KB (added by , 17 years ago) |
---|
-
wp-admin/includes/template.php
200 200 function wp_manage_posts_columns() { 201 201 $posts_columns = array(); 202 202 $posts_columns['id'] = '<div style="text-align: center">' . __('ID') . '</div>'; 203 if ( 'draft' === $_GET['post_status'] )203 if ( isset($_GET['post_status']) && 'draft' === $_GET['post_status'] ) 204 204 $posts_columns['modified'] = __('Modified'); 205 elseif ( 'pending' === $_GET['post_status'] )205 elseif ( isset($_GET['post_status']) && 'pending' === $_GET['post_status'] ) 206 206 $posts_columns['modified'] = __('Submitted'); 207 207 else 208 208 $posts_columns['date'] = __('When'); 209 209 $posts_columns['title'] = __('Title'); 210 210 $posts_columns['categories'] = __('Categories'); 211 if ( ! in_array($_GET['post_status'], array('pending', 'draft', 'future')) )211 if ( ! isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) 212 212 $posts_columns['comments'] = '<div style="text-align: center">' . __('Comments') . '</div>'; 213 213 $posts_columns['author'] = __('Author'); 214 214 $posts_columns = apply_filters('manage_posts_columns', $posts_columns); … … 320 320 $url = $user_object->user_url; 321 321 $short_url = str_replace( 'http://', '', $url ); 322 322 $short_url = str_replace( 'www.', '', $short_url ); 323 $first_name = ( isset( $user_object->first_name ) ) ? $user_object->first_name : ''; 324 $last_name = ( isset( $user_object->last_name ) ) ? $user_object->last_name : ''; 323 325 if ('/' == substr( $short_url, -1 )) 324 326 $short_url = substr( $short_url, 0, -1 ); 325 327 if ( strlen( $short_url ) > 35 ) … … 328 330 $r = "<tr id='user-$user_object->ID'$style> 329 331 <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td> 330 332 <td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td> 331 <td><label for='user_{$user_object->ID}'>$ user_object->first_name $user_object->last_name</label></td>333 <td><label for='user_{$user_object->ID}'>$first_name $last_name</label></td> 332 334 <td><a href='mailto:$email' title='" . sprintf( __('e-mail: %s' ), $email ) . "'>$email</a></td> 333 335 <td><a href='$url' title='website: $url'>$short_url</a></td>"; 334 336 $r .= "\n\t\t<td align='center'>"; … … 546 548 global $wp_locale, $post, $comment; 547 549 548 550 if ( $for_post ) 549 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && ( !$post->post_date|| '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;551 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (empty($post->post_date) || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 550 552 551 553 $tab_index_attribute = ''; 552 554 if ( (int) $tab_index > 0 ) … … 555 557 echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>'; 556 558 557 559 $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 ); 558 $post_date = ($for_post) ? $post->post_date : $comment->comment_date; 560 $post_date = ( ! empty( $post->post_date ) ) ? $post->post_date : null; 561 $comment_date = ( ! empty( $comment->comment_date ) ) ? $comment->comment_date : null; 562 $post_date = ($for_post) ? $post_date : $comment_date; 559 563 $jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj ); 560 564 $mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj ); 561 565 $aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj ); … … 732 736 733 737 function wp_remember_old_slug() { 734 738 global $post; 735 $name = attribute_escape($post->post_name); // just in case739 $name = ( ! empty($post->post_name) ) ? attribute_escape($post->post_name) : ''; // just in case 736 740 if ( strlen($name) ) 737 741 echo '<input type="hidden" id="wp-old-slug" name="wp-old-slug" value="' . $name . '" />'; 738 742 }