WordPress.org

Make WordPress Core

Changeset 7352


Ignore:
Timestamp:
03/17/2008 10:18:32 PM (13 years ago)
Author:
ryan
Message:

Display 15 posts. Remove no longer needed add-post AJAX action. Props johnhennmacc. fixes #6264

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r7336 r7352  
    2323$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
    2424switch ( $action = $_POST['action'] ) :
    25 case 'add-post' :
    26     check_ajax_referer( 'add-post' );
    27     add_filter( 'post_limits', $limit_filter = create_function( '$a', '$b = split(" ",$a); if ( !isset($b[2]) ) return $a; $start = intval(trim($b[1])) / 20 * 15; if ( !is_int($start) ) return $a; $start += intval(trim($b[2])) - 1; return "LIMIT $start, 1";' ) );
    28     wp_edit_posts_query( $_POST );
    29     if ( !have_posts() )
    30         die('1');
    31     $posts_columns = wp_manage_posts_columns();
    32     ob_start();
    33         include( 'edit-post-rows.php' );
    34         $data = ob_get_contents();
    35     ob_end_clean();
    36     if ( !preg_match('|<tbody.+?>(.+)</tbody>|s', $data, $matches) )
    37         my_dump($data);
    38     $data = trim($matches[1]);
    39     $x = new WP_Ajax_Response( array( 'what' => 'post', 'id' => $id, 'data' => $data ) );
    40     $x->send();
    41     break;
    4225case 'delete-comment' :
    4326    check_ajax_referer( "delete-comment_$id" );
  • trunk/wp-admin/includes/post.php

    r7338 r7352  
    548548    }
    549549
    550     wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=20&order=$order&orderby=$orderby");
     550    wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby");
    551551
    552552    return array($post_stati, $avail_post_stati);
Note: See TracChangeset for help on using the changeset viewer.