| 150 | | <p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p> |
| 151 | | <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> |
| 152 | | <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> |
| 153 | | |
| 154 | | <h3><?php _e( 'Choose what to export' ); ?></h3> |
| 155 | | <form action="" method="get" id="export-filters"> |
| 156 | | <input type="hidden" name="download" value="true" /> |
| 157 | | <p><label><input type="radio" name="content" value="all" checked="checked" /> <?php _e( 'All content' ); ?></label></p> |
| 158 | | <p class="description"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></p> |
| 159 | | |
| 160 | | <p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p> |
| 161 | | <ul id="post-filters" class="export-filters"> |
| 162 | | <li> |
| 163 | | <label><?php _e( 'Categories:' ); ?></label> |
| 164 | | <?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?> |
| 165 | | </li> |
| 166 | | <li> |
| 167 | | <label><?php _e( 'Authors:' ); ?></label> |
| 168 | | <?php |
| 169 | | $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" ); |
| 170 | | wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) ); |
| 171 | | ?> |
| 172 | | </li> |
| 173 | | <li> |
| 174 | | <label><?php _e( 'Date range:' ); ?></label> |
| 175 | | <select name="post_start_date"> |
| 176 | | <option value="0"><?php _e( 'Start Date' ); ?></option> |
| 177 | | <?php export_date_options(); ?> |
| 178 | | </select> |
| 179 | | <select name="post_end_date"> |
| 180 | | <option value="0"><?php _e( 'End Date' ); ?></option> |
| 181 | | <?php export_date_options(); ?> |
| 182 | | </select> |
| 183 | | </li> |
| 184 | | <li> |
| 185 | | <label><?php _e( 'Status:' ); ?></label> |
| 186 | | <select name="post_status"> |
| 187 | | <option value="0"><?php _e( 'All' ); ?></option> |
| 188 | | <?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' ); |
| 189 | | foreach ( $post_stati as $status ) : ?> |
| 190 | | <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> |
| 191 | | <?php endforeach; ?> |
| 192 | | </select> |
| 193 | | </li> |
| 194 | | </ul> |
| 195 | | |
| 196 | | <p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p> |
| 197 | | <ul id="page-filters" class="export-filters"> |
| 198 | | <li> |
| 199 | | <label><?php _e( 'Authors:' ); ?></label> |
| 200 | | <?php |
| 201 | | $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" ); |
| 202 | | wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) ); |
| 203 | | ?> |
| 204 | | </li> |
| 205 | | <li> |
| 206 | | <label><?php _e( 'Date range:' ); ?></label> |
| 207 | | <select name="page_start_date"> |
| 208 | | <option value="0"><?php _e( 'Start Date' ); ?></option> |
| 209 | | <?php export_date_options( 'page' ); ?> |
| 210 | | </select> |
| 211 | | <select name="page_end_date"> |
| 212 | | <option value="0"><?php _e( 'End Date' ); ?></option> |
| 213 | | <?php export_date_options( 'page' ); ?> |
| 214 | | </select> |
| 215 | | </li> |
| 216 | | <li> |
| 217 | | <label><?php _e( 'Status:' ); ?></label> |
| 218 | | <select name="page_status"> |
| 219 | | <option value="0"><?php _e( 'All' ); ?></option> |
| 220 | | <?php foreach ( $post_stati as $status ) : ?> |
| 221 | | <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> |
| 222 | | <?php endforeach; ?> |
| 223 | | </select> |
| 224 | | </li> |
| 225 | | </ul> |
| 226 | | |
| 227 | | <?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?> |
| 228 | | <p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p> |
| 229 | | <?php endforeach; ?> |
| 230 | | |
| 231 | | <?php |
| 232 | | /** |
| 233 | | * Fires after the export filters form. |
| 234 | | * |
| 235 | | * @since 3.5.0 |
| 236 | | */ |
| 237 | | do_action( 'export_filters' ); |
| 238 | | ?> |
| 239 | | |
| 240 | | <?php submit_button( __('Download Export File') ); ?> |
| 241 | | </form> |
| | 153 | <h3><?php _e( 'Choose what to export' ); ?></h3> |
| | 154 | <form action="" method="get" id="export-filters"> |
| | 155 | <input type="hidden" name="download" value="true"> |
| | 156 | <table class="form-table"> |
| | 157 | <thead> |
| | 158 | <tr> |
| | 159 | <th> |
| | 160 | <fieldset> |
| | 161 | <legend class="screen-reader-text"> |
| | 162 | <span>All content</span> |
| | 163 | </legend> |
| | 164 | <label> |
| | 165 | <input type="radio" name="content" value="all" checked="checked"> <?php _e('All content'); ?> |
| | 166 | </label> |
| | 167 | </fieldset> |
| | 168 | </th> |
| | 169 | <td> |
| | 170 | <span><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></span> |
| | 171 | </td> |
| | 172 | </tr> |
| | 173 | </thead> |
| | 174 | </table> |
| | 175 | <table class="form-table"> |
| | 176 | <thead> |
| | 177 | <tr> |
| | 178 | <th> |
| | 179 | <fieldset> |
| | 180 | <legend class="screen-reader-text"> |
| | 181 | <span>Posts</span> |
| | 182 | </legend> |
| | 183 | <label> |
| | 184 | <input type="radio" name="content" value="posts"> <?php _e('Posts'); ?> |
| | 185 | </label> |
| | 186 | </fieldset> |
| | 187 | </th> |
| | 188 | <td> |
| | 189 | <span><?php _e( 'This will contain all of your posts based on the selection criteria below.' ); ?></span> |
| | 190 | </td> |
| | 191 | </tr> |
| | 192 | </thead> |
| | 193 | <tbody id="post-filters" class="export-filters"> |
| | 194 | <tr> |
| | 195 | <th> |
| | 196 | <label><?php _e( 'Categories:' ); ?></label> |
| | 197 | </th> |
| | 198 | <td> |
| | 199 | <?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?> |
| | 200 | </td> |
| | 201 | </tr> |
| | 202 | <tr> |
| | 203 | <th> |
| | 204 | <label><?php _e( 'Authors:' ); ?></label> |
| | 205 | </th> |
| | 206 | <td> |
| | 207 | <?php |
| | 208 | $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" ); |
| | 209 | /** $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft'" ); */ |
| | 210 | wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) ); |
| | 211 | ?> |
| | 212 | </td> |
| | 213 | </tr> |
| | 214 | <tr> |
| | 215 | <th> |
| | 216 | <label><?php _e( 'Date range:' ); ?></label> |
| | 217 | </th> |
| | 218 | <td> |
| | 219 | <select name="post_start_date"> |
| | 220 | <option value="0"><?php _e( 'Start Date' ); ?></option> |
| | 221 | <?php export_date_options(); ?> |
| | 222 | </select> |
| | 223 | <select name="post_end_date"> |
| | 224 | <option value="0"><?php _e( 'End Date' ); ?></option> |
| | 225 | <?php export_date_options(); ?> |
| | 226 | </select> |
| | 227 | </td> |
| | 228 | </tr> |
| | 229 | <tr> |
| | 230 | <th> |
| | 231 | <label><?php _e( 'Status:' ); ?></label> |
| | 232 | </th> |
| | 233 | <td> |
| | 234 | <select name="post_status"> |
| | 235 | <option value="0"><?php _e( 'All' ); ?></option> |
| | 236 | <?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' ); |
| | 237 | foreach ( $post_stati as $status ) : ?> |
| | 238 | <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> |
| | 239 | <?php endforeach; ?> |
| | 240 | </select> |
| | 241 | </td> |
| | 242 | </tr> |
| | 243 | </tbody> |
| | 244 | </table> |
| | 245 | <table class="form-table"> |
| | 246 | <thead> |
| | 247 | <tr> |
| | 248 | <th> |
| | 249 | <fieldset> |
| | 250 | <legend class="screen-reader-text"> |
| | 251 | <span>Pages</span> |
| | 252 | </legend> |
| | 253 | <label> |
| | 254 | <input type="radio" name="content" value="pages"> <?php _e('Pages'); ?> |
| | 255 | </label> |
| | 256 | </fieldset> |
| | 257 | </th> |
| | 258 | <td> |
| | 259 | <span><?php _e( 'This will contain all of your pages based on the selection criteria below.' ); ?></span> |
| | 260 | </td> |
| | 261 | </tr> |
| | 262 | </thead> |
| | 263 | <tbody id="page-filters" class="export-filters"> |
| | 264 | <tr> |
| | 265 | <th> |
| | 266 | <label><?php _e( 'Authors:' ); ?></label> |
| | 267 | </th> |
| | 268 | <td> |
| | 269 | <?php |
| | 270 | $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" ); |
| | 271 | wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) ); |
| | 272 | ?> |
| | 273 | </td> |
| | 274 | </tr> |
| | 275 | <tr> |
| | 276 | <th> |
| | 277 | <label><?php _e( 'Date range:' ); ?></label> |
| | 278 | </th> |
| | 279 | <td> |
| | 280 | <select name="page_start_date"> |
| | 281 | <option value="0"><?php _e( 'Start Date' ); ?></option> |
| | 282 | <?php export_date_options( 'page' ); ?> |
| | 283 | </select> |
| | 284 | <select name="page_end_date"> |
| | 285 | <option value="0"><?php _e( 'End Date' ); ?></option> |
| | 286 | <?php export_date_options( 'page' ); ?> |
| | 287 | </select> |
| | 288 | </td> |
| | 289 | </tr> |
| | 290 | <tr> |
| | 291 | <th> |
| | 292 | <label><?php _e( 'Status:' ); ?></label> |
| | 293 | </th> |
| | 294 | <td> |
| | 295 | <select name="page_status"> |
| | 296 | <option value="0"><?php _e( 'All' ); ?></option> |
| | 297 | <?php foreach ( $post_stati as $status ) : ?> |
| | 298 | <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> |
| | 299 | <?php endforeach; ?> |
| | 300 | </select> |
| | 301 | </td> |
| | 302 | </tr> |
| | 303 | </tbody> |
| | 304 | </table> |
| | 305 | <?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?> |
| | 306 | <table class="form-table"> |
| | 307 | <thead> |
| | 308 | <tr> |
| | 309 | <th> |
| | 310 | <fieldset> |
| | 311 | <legend class="screen-reader-text"> |
| | 312 | <span><?php echo esc_html( $post_type->label ); ?></span> |
| | 313 | </legend> |
| | 314 | <label> |
| | 315 | <input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>"> <?php echo esc_html( $post_type->label ); ?> |
| | 316 | </label> |
| | 317 | </fieldset> |
| | 318 | </th> |
| | 319 | </tr> |
| | 320 | </thead> |
| | 321 | </table> |
| | 322 | <?php endforeach; ?> |
| | 323 | <?php |
| | 324 | /** |
| | 325 | * Fires after the export filters form. |
| | 326 | * |
| | 327 | * @since 3.5.0 |
| | 328 | */ |
| | 329 | do_action( 'export_filters' ); |
| | 330 | ?> |
| | 331 | <?php submit_button( __('Download Export File') ); ?> |
| | 332 | </form> |