From 3624366045a8227c3dbf421c5a6f79fb29986576 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 19 Sep 2015 16:46:17 +0000 Subject: [PATCH] Export: allow Media to exported separately from other types. Props PhilipLakin. Fixes #32230. git-svn-id: https://develop.svn.wordpress.org/trunk@34326 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/export.php | 26 ++++++++++++++++++++++++-- src/wp-admin/includes/export.php | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/export.php b/src/wp-admin/export.php index 9e34c7a797..50383e6e10 100644 --- a/src/wp-admin/export.php +++ b/src/wp-admin/export.php @@ -31,6 +31,7 @@ function export_add_js() { form.find('input:radio').change(function() { filters.slideUp('fast'); switch ( $(this).val() ) { + case 'attachment': $('#attachment-filters').slideDown(); break; case 'posts': $('#post-filters').slideDown(); break; case 'pages': $('#page-filters').slideDown(); break; } @@ -89,7 +90,15 @@ if ( isset( $_GET['download'] ) ) { if ( $_GET['page_status'] ) $args['status'] = $_GET['page_status']; - } else { + } elseif ( 'attachment' == $_GET['content'] ) { + $args['content'] = 'attachment'; + + if ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) { + $args['start_date'] = $_GET['attachment_start_date']; + $args['end_date'] = $_GET['attachment_end_date']; + } + } + else { $args['content'] = $_GET['content']; } @@ -225,7 +234,20 @@ function export_date_options( $post_type = 'post' ) { false, 'can_export' => true ), 'objects' ) as $post_type ) : ?>

- +

+ prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] );