changeset 204 | 09a1c134465b |
parent 194 | 32102edaa81b |
203:f507feede89a | 204:09a1c134465b |
---|---|
14 |
14 |
15 /** Load WordPress export API */ |
15 /** Load WordPress export API */ |
16 require_once('./includes/export.php'); |
16 require_once('./includes/export.php'); |
17 $title = __('Export'); |
17 $title = __('Export'); |
18 |
18 |
19 function add_js() { |
19 /** |
20 * Display JavaScript on the page. |
|
21 * |
|
22 * @since 3.5.0 |
|
23 */ |
|
24 function export_add_js() { |
|
20 ?> |
25 ?> |
21 <script type="text/javascript"> |
26 <script type="text/javascript"> |
22 //<![CDATA[ |
27 //<![CDATA[ |
23 jQuery(document).ready(function($){ |
28 jQuery(document).ready(function($){ |
24 var form = $('#export-filters'), |
29 var form = $('#export-filters'), |
34 }); |
39 }); |
35 //]]> |
40 //]]> |
36 </script> |
41 </script> |
37 <?php |
42 <?php |
38 } |
43 } |
39 add_action( 'admin_head', 'add_js' ); |
44 add_action( 'admin_head', 'export_add_js' ); |
40 |
45 |
41 get_current_screen()->add_help_tab( array( |
46 get_current_screen()->add_help_tab( array( |
42 'id' => 'overview', |
47 'id' => 'overview', |
43 'title' => __('Overview'), |
48 'title' => __('Overview'), |
44 '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>' . |
49 '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>' . |
86 if ( $_GET['page_status'] ) |
91 if ( $_GET['page_status'] ) |
87 $args['status'] = $_GET['page_status']; |
92 $args['status'] = $_GET['page_status']; |
88 } else { |
93 } else { |
89 $args['content'] = $_GET['content']; |
94 $args['content'] = $_GET['content']; |
90 } |
95 } |
96 |
|
97 $args = apply_filters( 'export_args', $args ); |
|
91 |
98 |
92 export_wp( $args ); |
99 export_wp( $args ); |
93 die(); |
100 die(); |
94 } |
101 } |
95 |
102 |
202 |
209 |
203 <?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?> |
210 <?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?> |
204 <p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p> |
211 <p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p> |
205 <?php endforeach; ?> |
212 <?php endforeach; ?> |
206 |
213 |
207 <?php submit_button( __('Download Export File'), 'secondary' ); ?> |
214 <?php do_action( 'export_filters' ) ?> |
215 |
|
216 <?php submit_button( __('Download Export File') ); ?> |
|
208 </form> |
217 </form> |
209 </div> |
218 </div> |
210 |
219 |
211 <?php include('admin-footer.php'); ?> |
220 <?php include('admin-footer.php'); ?> |