WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-admin/includes/post.php

    r15032 r15452  
    377377        foreach ( (array) $old_posts as $delete )
    378378            wp_delete_post( $delete, true ); // Force delete
    379         $post = get_post( wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) ) );
     379        $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
     380        $post = get_post( $post_id );
    380381    } else {
    381382        $post->ID = 0;
     
    894895    $posts_per_page = (int) get_user_option( $per_page );
    895896    if ( empty( $posts_per_page ) || $posts_per_page < 1 )
    896         $posts_per_page = 15;
     897        $posts_per_page = 20;
     898
    897899    $posts_per_page = apply_filters( $per_page, $posts_per_page );
    898 
     900    $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page, $post_type );
    899901
    900902    $query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page');
     
    11711173 */
    11721174function wp_check_post_lock( $post_id ) {
    1173     global $current_user;
    1174 
    11751175    if ( !$post = get_post( $post_id ) )
    11761176        return false;
     
    11811181    $time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 );
    11821182
    1183     if ( $lock && $lock > time() - $time_window && $last != $current_user->ID )
     1183    if ( $lock && $lock > time() - $time_window && $last != get_current_user_id() )
    11841184        return $last;
    11851185    return false;
     
    11951195 */
    11961196function wp_set_post_lock( $post_id ) {
    1197     global $current_user;
    11981197    if ( !$post = get_post( $post_id ) )
    11991198        return false;
    1200     if ( !$current_user || !$current_user->ID )
     1199    if ( 0 == get_current_user_id() )
    12011200        return false;
    12021201
     
    12531252        $new_autosave = _wp_post_revision_fields( $_POST, true );
    12541253        $new_autosave['ID'] = $old_autosave->ID;
    1255         $current_user = wp_get_current_user();
    1256         $new_autosave['post_author'] = $current_user->ID;
     1254        $new_autosave['post_author'] = get_current_user_id();
    12571255        return wp_update_post( $new_autosave );
    12581256    }
Note: See TracChangeset for help on using the changeset viewer.