Post and page management filter additions from mdawaffe. see #3945

git-svn-id: http://svn.automattic.com/wordpress/trunk@5587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2007-05-29 04:28:10 +00:00
parent c09ea05543
commit 4efb612c1a
5 changed files with 101 additions and 58 deletions

View File

@@ -284,7 +284,7 @@ function wp_upload_posts_where( $where ) {
}
function wp_upload_tab_browse() {
global $wpdb, $action, $paged;
global $action, $paged;
$old_vars = compact( 'paged' );
switch ( $action ) :
@@ -301,11 +301,7 @@ function wp_upload_tab_browse() {
add_action( 'pre_get_posts', 'wp_upload_grab_attachments' );
if ( 'browse' == $tab && $post_id )
add_filter( 'posts_where', 'wp_upload_posts_where' );
$attachments = query_posts("what_to_show=posts&posts_per_page=10&paged=$paged");
$count_query = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'";
if ( $post_id )
$count_query .= " AND post_parent = '$post_id'";
$total = $wpdb->get_var($count_query);
$attachments = query_posts("what_to_show=posts&post_status=any&posts_per_page=10&paged=$paged");
echo "<ul id='upload-files'>\n";
if ( have_posts() ) : while ( have_posts() ) : the_post();
@@ -357,4 +353,4 @@ function wp_upload_admin_head() {
}
}
?>
?>