diff --git wp-admin/export.php wp-admin/export.php
index daba6e3..f977996 100644
|
|
|
function export_add_js() {
|
| 31 | 31 | form.find('input:radio').change(function() { |
| 32 | 32 | filters.slideUp('fast'); |
| 33 | 33 | switch ( $(this).val() ) { |
| | 34 | case 'attachment': $('#attachment-filters').slideDown(); break; |
| 34 | 35 | case 'posts': $('#post-filters').slideDown(); break; |
| 35 | 36 | case 'pages': $('#page-filters').slideDown(); break; |
| 36 | 37 | } |
| … |
… |
if ( isset( $_GET['download'] ) ) {
|
| 89 | 90 | |
| 90 | 91 | if ( $_GET['page_status'] ) |
| 91 | 92 | $args['status'] = $_GET['page_status']; |
| 92 | | } else { |
| | 93 | } elseif ( 'attachment' == $_GET['content'] ) { |
| | 94 | $args['content'] = 'attachment'; |
| | 95 | |
| | 96 | if ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) { |
| | 97 | $args['start_date'] = $_GET['attachment_start_date']; |
| | 98 | $args['end_date'] = $_GET['attachment_end_date']; |
| | 99 | } |
| | 100 | } |
| | 101 | else { |
| 93 | 102 | $args['content'] = $_GET['content']; |
| 94 | 103 | } |
| 95 | 104 | |
| … |
… |
function export_date_options( $post_type = 'post' ) {
|
| 225 | 234 | <?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?> |
| 226 | 235 | <p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p> |
| 227 | 236 | <?php endforeach; ?> |
| 228 | | |
| | 237 | <p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p> |
| | 238 | <ul id="attachment-filters" class="export-filters"> |
| | 239 | <li> |
| | 240 | <label><?php _e( 'Date range:' ); ?></label> |
| | 241 | <select name="attachment_start_date"> |
| | 242 | <option value="0"><?php _e( 'Start Date' ); ?></option> |
| | 243 | <?php export_date_options( 'attachment' ); ?> |
| | 244 | </select> |
| | 245 | <select name="attachment_end_date"> |
| | 246 | <option value="0"><?php _e( 'End Date' ); ?></option> |
| | 247 | <?php export_date_options( 'attachment' ); ?> |
| | 248 | </select> |
| | 249 | </li> |
| | 250 | </ul> |
| 229 | 251 | <?php |
| 230 | 252 | /** |
| 231 | 253 | * Fires after the export filters form. |
diff --git wp-admin/includes/export.php wp-admin/includes/export.php
index cd50e61..877c26a 100644
|
|
|
function export_wp( $args = array() ) {
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | | if ( 'post' == $args['content'] || 'page' == $args['content'] ) { |
| | 75 | if ( 'post' == $args['content'] || 'page' == $args['content'] || 'attachment' == $args['content'] ) { |
| 76 | 76 | if ( $args['author'] ) |
| 77 | 77 | $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] ); |
| 78 | 78 | |