From eae7b967de268c21edc66332bcc2bfe45b3fa55d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 17 Mar 2008 22:18:32 +0000 Subject: [PATCH] Display 15 posts. Remove no longer needed add-post AJAX action. Props johnhennmacc. fixes #6264 git-svn-id: https://develop.svn.wordpress.org/trunk@7352 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 17 ----------------- wp-admin/includes/post.php | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 2fd92eeb38..44d64781a2 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -22,23 +22,6 @@ if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) { $id = isset($_POST['id'])? (int) $_POST['id'] : 0; switch ( $action = $_POST['action'] ) : -case 'add-post' : - check_ajax_referer( 'add-post' ); - 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";' ) ); - wp_edit_posts_query( $_POST ); - if ( !have_posts() ) - die('1'); - $posts_columns = wp_manage_posts_columns(); - ob_start(); - include( 'edit-post-rows.php' ); - $data = ob_get_contents(); - ob_end_clean(); - if ( !preg_match('|(.+)|s', $data, $matches) ) - my_dump($data); - $data = trim($matches[1]); - $x = new WP_Ajax_Response( array( 'what' => 'post', 'id' => $id, 'data' => $data ) ); - $x->send(); - break; case 'delete-comment' : check_ajax_referer( "delete-comment_$id" ); if ( !$comment = get_comment( $id ) ) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index b4db0263a4..5909238926 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -547,7 +547,7 @@ function wp_edit_posts_query( $q = false ) { $orderby = 'date'; } - wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=20&order=$order&orderby=$orderby"); + wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby"); return array($post_stati, $avail_post_stati); }