Make WordPress Core

Ticket #5607: remove_admin_notices7.diff

File remove_admin_notices7.diff, 4.0 KB (added by filosofo, 17 years ago)
  • wp-admin/includes/template.php

     
    200200function wp_manage_posts_columns() {
    201201        $posts_columns = array();
    202202        $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'] )
    204204                $posts_columns['modified'] = __('Modified');
    205         elseif ( 'pending' === $_GET['post_status'] )
     205        elseif ( isset($_GET['post_status']) && 'pending' === $_GET['post_status'] )
    206206                $posts_columns['modified'] = __('Submitted');
    207207        else
    208208                $posts_columns['date'] = __('When');
    209209        $posts_columns['title'] = __('Title');
    210210        $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')) )
    212212                $posts_columns['comments'] = '<div style="text-align: center">' . __('Comments') . '</div>';
    213213        $posts_columns['author'] = __('Author');
    214214        $posts_columns = apply_filters('manage_posts_columns', $posts_columns);
     
    320320        $url = $user_object->user_url;
    321321        $short_url = str_replace( 'http://', '', $url );
    322322        $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 : '';
    323325        if ('/' == substr( $short_url, -1 ))
    324326                $short_url = substr( $short_url, 0, -1 );
    325327        if ( strlen( $short_url ) > 35 )
     
    328330        $r = "<tr id='user-$user_object->ID'$style>
    329331                <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>
    330332                <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>
    332334                <td><a href='mailto:$email' title='" . sprintf( __('e-mail: %s' ), $email ) . "'>$email</a></td>
    333335                <td><a href='$url' title='website: $url'>$short_url</a></td>";
    334336        $r .= "\n\t\t<td align='center'>";
     
    546548        global $wp_locale, $post, $comment;
    547549
    548550        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;
    550552       
    551553        $tab_index_attribute = '';
    552554        if ( (int) $tab_index > 0 )
     
    555557        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>';
    556558
    557559        $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;
    559563        $jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj );
    560564        $mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj );
    561565        $aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj );
     
    732736
    733737function wp_remember_old_slug() {
    734738        global $post;
    735         $name = attribute_escape($post->post_name); // just in case
     739        $name = ( ! empty($post->post_name) ) ? attribute_escape($post->post_name) : ''; // just in case
    736740        if ( strlen($name) )
    737741                echo '<input type="hidden" id="wp-old-slug" name="wp-old-slug" value="' . $name . '" />';
    738742}