~canonical-sysadmins/wordpress/4.5.2

« back to all changes in this revision

Viewing changes to wp-admin/export.php

  • Committer: Manuel Seelaus
  • Date: 2015-12-09 17:47:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: manuel.seelaus@canonical.com-20151209174718-coxethm2swbeqksy
Merge WP4.4 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
                        }
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
 
149
158
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?></p>
150
159
<p><?php _e('Once you&#8217;ve saved the download file, you can use the Import function in another WordPress installation to import the content from this site.'); ?></p>
151
160
 
152
 
<h3><?php _e( 'Choose what to export' ); ?></h3>
 
161
<h2><?php _e( 'Choose what to export' ); ?></h2>
153
162
<form method="get" id="export-filters">
 
163
<fieldset>
 
164
<legend class="screen-reader-text"><?php _e( 'Content to export' ); ?></legend>
154
165
<input type="hidden" name="download" value="true" />
155
 
<p><label><input type="radio" name="content" value="all" checked="checked" /> <?php _e( 'All content' ); ?></label></p>
156
 
<p class="description"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></p>
 
166
<p><label><input type="radio" name="content" value="all" checked="checked" aria-describedby="all-content-desc" /> <?php _e( 'All content' ); ?></label></p>
 
167
<p class="description" id="all-content-desc"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></p>
157
168
 
158
169
<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
159
170
<ul id="post-filters" class="export-filters">
160
171
        <li>
161
 
                <label><?php _e( 'Categories:' ); ?></label>
 
172
                <label><span class="label-responsive"><?php _e( 'Categories:' ); ?></span>
162
173
                <?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?>
 
174
                </label>
163
175
        </li>
164
176
        <li>
165
 
                <label><?php _e( 'Authors:' ); ?></label>
166
 
<?php
 
177
                <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
 
178
                <?php
167
179
                $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
168
180
                wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) );
169
 
?>
170
 
        </li>
171
 
        <li>
172
 
                <label><?php _e( 'Date range:' ); ?></label>
173
 
                <select name="post_start_date">
174
 
                        <option value="0"><?php _e( 'Start Date' ); ?></option>
175
 
                        <?php export_date_options(); ?>
176
 
                </select>
177
 
                <select name="post_end_date">
178
 
                        <option value="0"><?php _e( 'End Date' ); ?></option>
179
 
                        <?php export_date_options(); ?>
180
 
                </select>
181
 
        </li>
182
 
        <li>
183
 
                <label><?php _e( 'Status:' ); ?></label>
184
 
                <select name="post_status">
 
181
                ?>
 
182
                </label>
 
183
        </li>
 
184
        <li>
 
185
                <fieldset>
 
186
                <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
 
187
                <label for="post-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
 
188
                <select name="post_start_date" id="post-start-date">
 
189
                        <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
 
190
                        <?php export_date_options(); ?>
 
191
                </select>
 
192
                <label for="post-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
 
193
                <select name="post_end_date" id="post-end-date">
 
194
                        <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
 
195
                        <?php export_date_options(); ?>
 
196
                </select>
 
197
                </fieldset>
 
198
        </li>
 
199
        <li>
 
200
                <label for="post-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
 
201
                <select name="post_status" id="post-status">
185
202
                        <option value="0"><?php _e( 'All' ); ?></option>
186
203
                        <?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
187
204
                        foreach ( $post_stati as $status ) : ?>
194
211
<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p>
195
212
<ul id="page-filters" class="export-filters">
196
213
        <li>
197
 
                <label><?php _e( 'Authors:' ); ?></label>
198
 
<?php
 
214
                <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span>
 
215
                <?php
199
216
                $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
200
217
                wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) );
201
 
?>
202
 
        </li>
203
 
        <li>
204
 
                <label><?php _e( 'Date range:' ); ?></label>
205
 
                <select name="page_start_date">
206
 
                        <option value="0"><?php _e( 'Start Date' ); ?></option>
207
 
                        <?php export_date_options( 'page' ); ?>
208
 
                </select>
209
 
                <select name="page_end_date">
210
 
                        <option value="0"><?php _e( 'End Date' ); ?></option>
211
 
                        <?php export_date_options( 'page' ); ?>
212
 
                </select>
213
 
        </li>
214
 
        <li>
215
 
                <label><?php _e( 'Status:' ); ?></label>
216
 
                <select name="page_status">
 
218
                ?>
 
219
                </label>
 
220
        </li>
 
221
        <li>
 
222
                <fieldset>
 
223
                <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
 
224
                <label for="page-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
 
225
                <select name="page_start_date" id="page-start-date">
 
226
                        <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
 
227
                        <?php export_date_options( 'page' ); ?>
 
228
                </select>
 
229
                <label for="page-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
 
230
                <select name="page_end_date" id="page-end-date">
 
231
                        <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
 
232
                        <?php export_date_options( 'page' ); ?>
 
233
                </select>
 
234
                </fieldset>
 
235
        </li>
 
236
        <li>
 
237
                <label for="page-status" class="label-responsive"><?php _e( 'Status:' ); ?></label>
 
238
                <select name="page_status" id="page-status">
217
239
                        <option value="0"><?php _e( 'All' ); ?></option>
218
240
                        <?php foreach ( $post_stati as $status ) : ?>
219
241
                        <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
226
248
<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
249
<?php endforeach; ?>
228
250
 
 
251
<p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p>
 
252
<ul id="attachment-filters" class="export-filters">
 
253
        <li>
 
254
                <fieldset>
 
255
                <legend class="screen-reader-text"><?php _e( 'Date range:' ); ?></legend>
 
256
                <label for="attachment-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label>
 
257
                <select name="attachment_start_date" id="attachment-start-date">
 
258
                        <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
 
259
                        <?php export_date_options( 'attachment' ); ?>
 
260
                </select>
 
261
                <label for="attachment-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label>
 
262
                <select name="attachment_end_date" id="attachment-end-date">
 
263
                        <option value="0"><?php _e( '&mdash; Select &mdash;' ); ?></option>
 
264
                        <?php export_date_options( 'attachment' ); ?>
 
265
                </select>
 
266
                </fieldset>
 
267
        </li>
 
268
</ul>
 
269
 
 
270
</fieldset>
229
271
<?php
230
272
/**
231
 
 * Fires after the export filters form.
 
273
 * Fires at the end of the export filters form.
232
274
 *
233
275
 * @since 3.5.0
234
276
 */