author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* WordPress Export Administration Screen |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** Load WordPress Bootstrap */ |
|
16 | 10 |
require_once __DIR__ . '/admin.php'; |
0 | 11 |
|
9 | 12 |
if ( ! current_user_can( 'export' ) ) { |
13 |
wp_die( __( 'Sorry, you are not allowed to export the content of this site.' ) ); |
|
14 |
} |
|
0 | 15 |
|
16 |
/** Load WordPress export API */ |
|
16 | 17 |
require_once ABSPATH . 'wp-admin/includes/export.php'; |
19 | 18 |
|
19 |
// Used in the HTML title tag. |
|
9 | 20 |
$title = __( 'Export' ); |
0 | 21 |
|
22 |
/** |
|
23 |
* Display JavaScript on the page. |
|
24 |
* |
|
25 |
* @since 3.5.0 |
|
26 |
*/ |
|
27 |
function export_add_js() { |
|
9 | 28 |
?> |
0 | 29 |
<script type="text/javascript"> |
19 | 30 |
jQuery( function($) { |
16 | 31 |
var form = $('#export-filters'), |
32 |
filters = form.find('.export-filters'); |
|
33 |
filters.hide(); |
|
18 | 34 |
form.find('input:radio').on( 'change', function() { |
0 | 35 |
filters.slideUp('fast'); |
36 |
switch ( $(this).val() ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
37 |
case 'attachment': $('#attachment-filters').slideDown(); break; |
0 | 38 |
case 'posts': $('#post-filters').slideDown(); break; |
39 |
case 'pages': $('#page-filters').slideDown(); break; |
|
40 |
} |
|
16 | 41 |
}); |
19 | 42 |
} ); |
0 | 43 |
</script> |
9 | 44 |
<?php |
0 | 45 |
} |
46 |
add_action( 'admin_head', 'export_add_js' ); |
|
47 |
||
9 | 48 |
get_current_screen()->add_help_tab( |
49 |
array( |
|
50 |
'id' => 'overview', |
|
51 |
'title' => __( 'Overview' ), |
|
52 |
'content' => '<p>' . __( 'You can export a file of your site’s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.' ) . '</p>' . |
|
53 |
'<p>' . __( 'Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.' ) . '</p>', |
|
54 |
) |
|
55 |
); |
|
0 | 56 |
|
57 |
get_current_screen()->set_help_sidebar( |
|
9 | 58 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
59 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-export-screen/">Documentation on Export</a>' ) . '</p>' . |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
60 |
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' |
0 | 61 |
); |
62 |
||
5 | 63 |
// If the 'download' URL parameter is set, a WXR export file is baked and returned. |
0 | 64 |
if ( isset( $_GET['download'] ) ) { |
65 |
$args = array(); |
|
66 |
||
16 | 67 |
if ( ! isset( $_GET['content'] ) || 'all' === $_GET['content'] ) { |
0 | 68 |
$args['content'] = 'all'; |
16 | 69 |
} elseif ( 'posts' === $_GET['content'] ) { |
0 | 70 |
$args['content'] = 'post'; |
71 |
||
9 | 72 |
if ( $_GET['cat'] ) { |
0 | 73 |
$args['category'] = (int) $_GET['cat']; |
9 | 74 |
} |
0 | 75 |
|
9 | 76 |
if ( $_GET['post_author'] ) { |
0 | 77 |
$args['author'] = (int) $_GET['post_author']; |
9 | 78 |
} |
0 | 79 |
|
80 |
if ( $_GET['post_start_date'] || $_GET['post_end_date'] ) { |
|
81 |
$args['start_date'] = $_GET['post_start_date']; |
|
9 | 82 |
$args['end_date'] = $_GET['post_end_date']; |
0 | 83 |
} |
84 |
||
9 | 85 |
if ( $_GET['post_status'] ) { |
0 | 86 |
$args['status'] = $_GET['post_status']; |
9 | 87 |
} |
16 | 88 |
} elseif ( 'pages' === $_GET['content'] ) { |
0 | 89 |
$args['content'] = 'page'; |
90 |
||
9 | 91 |
if ( $_GET['page_author'] ) { |
0 | 92 |
$args['author'] = (int) $_GET['page_author']; |
9 | 93 |
} |
0 | 94 |
|
95 |
if ( $_GET['page_start_date'] || $_GET['page_end_date'] ) { |
|
96 |
$args['start_date'] = $_GET['page_start_date']; |
|
9 | 97 |
$args['end_date'] = $_GET['page_end_date']; |
0 | 98 |
} |
99 |
||
9 | 100 |
if ( $_GET['page_status'] ) { |
0 | 101 |
$args['status'] = $_GET['page_status']; |
9 | 102 |
} |
16 | 103 |
} elseif ( 'attachment' === $_GET['content'] ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
104 |
$args['content'] = 'attachment'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
105 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
106 |
if ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
107 |
$args['start_date'] = $_GET['attachment_start_date']; |
9 | 108 |
$args['end_date'] = $_GET['attachment_end_date']; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
109 |
} |
9 | 110 |
} else { |
0 | 111 |
$args['content'] = $_GET['content']; |
112 |
} |
|
113 |
||
114 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
115 |
* Filters the export args. |
0 | 116 |
* |
117 |
* @since 3.5.0 |
|
118 |
* |
|
119 |
* @param array $args The arguments to send to the exporter. |
|
120 |
*/ |
|
121 |
$args = apply_filters( 'export_args', $args ); |
|
122 |
||
123 |
export_wp( $args ); |
|
124 |
die(); |
|
125 |
} |
|
126 |
||
16 | 127 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 128 |
|
129 |
/** |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
130 |
* Creates the date options fields for exporting a given post type. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
131 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
132 |
* @since 3.1.0 |
0 | 133 |
* |
5 | 134 |
* @global wpdb $wpdb WordPress database abstraction object. |
16 | 135 |
* @global WP_Locale $wp_locale WordPress date and time locale object. |
0 | 136 |
* |
137 |
* @param string $post_type The post type. Default 'post'. |
|
138 |
*/ |
|
139 |
function export_date_options( $post_type = 'post' ) { |
|
140 |
global $wpdb, $wp_locale; |
|
141 |
||
9 | 142 |
$months = $wpdb->get_results( |
143 |
$wpdb->prepare( |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
144 |
"SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
145 |
FROM $wpdb->posts |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
146 |
WHERE post_type = %s AND post_status != 'auto-draft' |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
147 |
ORDER BY post_date DESC", |
9 | 148 |
$post_type |
149 |
) |
|
150 |
); |
|
0 | 151 |
|
152 |
$month_count = count( $months ); |
|
16 | 153 |
if ( ! $month_count || ( 1 === $month_count && 0 === (int) $months[0]->month ) ) { |
0 | 154 |
return; |
9 | 155 |
} |
0 | 156 |
|
157 |
foreach ( $months as $date ) { |
|
16 | 158 |
if ( 0 === (int) $date->year ) { |
0 | 159 |
continue; |
9 | 160 |
} |
0 | 161 |
|
162 |
$month = zeroise( $date->month, 2 ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
163 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
164 |
printf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
165 |
'<option value="%1$s">%2$s</option>', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
166 |
esc_attr( $date->year . '-' . $month ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
167 |
$wp_locale->get_month( $month ) . ' ' . $date->year |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
168 |
); |
0 | 169 |
} |
170 |
} |
|
171 |
?> |
|
172 |
||
173 |
<div class="wrap"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
174 |
<h1><?php echo esc_html( $title ); ?></h1> |
0 | 175 |
|
9 | 176 |
<p><?php _e( 'When you click the button below WordPress will create an XML file for you to save to your computer.' ); ?></p> |
19 | 177 |
<p><?php _e( 'This format, which is called WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.' ); ?></p> |
9 | 178 |
<p><?php _e( 'Once you’ve saved the download file, you can use the Import function in another WordPress installation to import the content from this site.' ); ?></p> |
0 | 179 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
180 |
<h2><?php _e( 'Choose what to export' ); ?></h2> |
5 | 181 |
<form method="get" id="export-filters"> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
<fieldset> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
183 |
<legend class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
184 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
185 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
186 |
_e( 'Content to export' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
187 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
188 |
</legend> |
0 | 189 |
<input type="hidden" name="download" value="true" /> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
190 |
<p><label><input type="radio" name="content" value="all" checked="checked" aria-describedby="all-content-desc" /> <?php _e( 'All content' ); ?></label></p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
191 |
<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> |
0 | 192 |
|
16 | 193 |
<p><label><input type="radio" name="content" value="posts" /> <?php _ex( 'Posts', 'post type general name' ); ?></label></p> |
0 | 194 |
<ul id="post-filters" class="export-filters"> |
195 |
<li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
196 |
<label><span class="label-responsive"><?php _e( 'Categories:' ); ?></span> |
9 | 197 |
<?php wp_dropdown_categories( array( 'show_option_all' => __( 'All' ) ) ); ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
198 |
</label> |
0 | 199 |
</li> |
200 |
<li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
201 |
<label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
202 |
<?php |
0 | 203 |
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" ); |
9 | 204 |
wp_dropdown_users( |
205 |
array( |
|
206 |
'include' => $authors, |
|
207 |
'name' => 'post_author', |
|
208 |
'multi' => true, |
|
209 |
'show_option_all' => __( 'All' ), |
|
210 |
'show' => 'display_name_with_login', |
|
211 |
) |
|
212 |
); |
|
213 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
214 |
</label> |
0 | 215 |
</li> |
216 |
<li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
217 |
<fieldset> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
218 |
<legend class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
219 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
220 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
221 |
_e( 'Date range:' ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
222 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
223 |
</legend> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
224 |
<label for="post-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
225 |
<select name="post_start_date" id="post-start-date"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
226 |
<option value="0"><?php _e( '— Select —' ); ?></option> |
0 | 227 |
<?php export_date_options(); ?> |
228 |
</select> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
229 |
<label for="post-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
230 |
<select name="post_end_date" id="post-end-date"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
231 |
<option value="0"><?php _e( '— Select —' ); ?></option> |
0 | 232 |
<?php export_date_options(); ?> |
233 |
</select> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
234 |
</fieldset> |
0 | 235 |
</li> |
236 |
<li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
237 |
<label for="post-status" class="label-responsive"><?php _e( 'Status:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
238 |
<select name="post_status" id="post-status"> |
0 | 239 |
<option value="0"><?php _e( 'All' ); ?></option> |
9 | 240 |
<?php |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
241 |
$post_statuses = get_post_stati( array( 'internal' => false ), 'objects' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
242 |
foreach ( $post_statuses as $status ) : |
9 | 243 |
?> |
0 | 244 |
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> |
245 |
<?php endforeach; ?> |
|
246 |
</select> |
|
247 |
</li> |
|
248 |
</ul> |
|
249 |
||
250 |
<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p> |
|
251 |
<ul id="page-filters" class="export-filters"> |
|
252 |
<li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
253 |
<label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
254 |
<?php |
0 | 255 |
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" ); |
9 | 256 |
wp_dropdown_users( |
257 |
array( |
|
258 |
'include' => $authors, |
|
259 |
'name' => 'page_author', |
|
260 |
'multi' => true, |
|
261 |
'show_option_all' => __( 'All' ), |
|
262 |
'show' => 'display_name_with_login', |
|
263 |
) |
|
264 |
); |
|
265 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
266 |
</label> |
0 | 267 |
</li> |
268 |
<li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
269 |
<fieldset> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
270 |
<legend class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
271 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
272 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
273 |
_e( 'Date range:' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
274 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
275 |
</legend> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
276 |
<label for="page-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
277 |
<select name="page_start_date" id="page-start-date"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
278 |
<option value="0"><?php _e( '— Select —' ); ?></option> |
0 | 279 |
<?php export_date_options( 'page' ); ?> |
280 |
</select> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
281 |
<label for="page-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
282 |
<select name="page_end_date" id="page-end-date"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
283 |
<option value="0"><?php _e( '— Select —' ); ?></option> |
0 | 284 |
<?php export_date_options( 'page' ); ?> |
285 |
</select> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
286 |
</fieldset> |
0 | 287 |
</li> |
288 |
<li> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
289 |
<label for="page-status" class="label-responsive"><?php _e( 'Status:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
290 |
<select name="page_status" id="page-status"> |
0 | 291 |
<option value="0"><?php _e( 'All' ); ?></option> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
292 |
<?php foreach ( $post_statuses as $status ) : ?> |
0 | 293 |
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> |
294 |
<?php endforeach; ?> |
|
295 |
</select> |
|
296 |
</li> |
|
297 |
</ul> |
|
298 |
||
9 | 299 |
<?php |
300 |
foreach ( get_post_types( |
|
301 |
array( |
|
302 |
'_builtin' => false, |
|
303 |
'can_export' => true, |
|
304 |
), |
|
305 |
'objects' |
|
306 |
) as $post_type ) : |
|
307 |
?> |
|
0 | 308 |
<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p> |
309 |
<?php endforeach; ?> |
|
310 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
311 |
<p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
312 |
<ul id="attachment-filters" class="export-filters"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
313 |
<li> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
314 |
<fieldset> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
315 |
<legend class="screen-reader-text"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
316 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
317 |
/* translators: Hidden accessibility text. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
318 |
_e( 'Date range:' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
319 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
320 |
</legend> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
321 |
<label for="attachment-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
322 |
<select name="attachment_start_date" id="attachment-start-date"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
323 |
<option value="0"><?php _e( '— Select —' ); ?></option> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
324 |
<?php export_date_options( 'attachment' ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
325 |
</select> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
326 |
<label for="attachment-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
327 |
<select name="attachment_end_date" id="attachment-end-date"> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
328 |
<option value="0"><?php _e( '— Select —' ); ?></option> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
329 |
<?php export_date_options( 'attachment' ); ?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
330 |
</select> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
331 |
</fieldset> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
332 |
</li> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
333 |
</ul> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
334 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
335 |
</fieldset> |
0 | 336 |
<?php |
337 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
338 |
* Fires at the end of the export filters form. |
0 | 339 |
* |
340 |
* @since 3.5.0 |
|
341 |
*/ |
|
342 |
do_action( 'export_filters' ); |
|
343 |
?> |
|
344 |
||
9 | 345 |
<?php submit_button( __( 'Download Export File' ) ); ?> |
0 | 346 |
</form> |
347 |
</div> |
|
348 |
||
16 | 349 |
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> |