From c6d88f0bc6f8b8023041c697e517b2f84b65f2bb Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 22 Feb 2008 17:33:47 +0000 Subject: [PATCH] Media paging fix from filosofo and andy. fixes #5963 git-svn-id: http://svn.automattic.com/wordpress/trunk@6981 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 3d293e24a..4dd163e9c 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -38,7 +38,7 @@ if ( 1 == $_GET['c'] ) require_once('admin-header.php'); -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; return "LIMIT $start, 20";' ) ); +add_filter( 'post_limits', $limit_filter = create_function( '$a', 'if ( empty($_GET["paged"]) ) $_GET["paged"] = 1; $start = ( intval($_GET["paged"]) - 1 ) * 15; return "LIMIT $start, 20";' ) ); list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); $wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra )