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.6.3.1 2.6.3.2 2.7.0.5 2.7.1.1 2.7.2 2.7.2.1 2.7.3 2.7.3.1 2.7.3.2 2.7.4.1 2.7.4.2 2.7.4.3 2.7.4.4 2.7.4.5 2.8.0.4 2.8.0.5 2.8.0.7 2.8.1.1 2.8.1.2 2.8.1.3 2.8.2.2 2.8.3.1 2.8.3.2 2.8.3.4 2.8.3.5 2.8.3.6 2.8.3.7 2.8.3.9 2.8.4.1 2.8.4.2 2.8.4.3 2.8.4.4 2.8.5.3
beaver-builder-lite-version / includes / export.php
beaver-builder-lite-version / includes Last commit date
updater 8 years ago vendor 8 years ago admin-posts.php 8 years ago admin-settings-js-config.php 8 years ago admin-settings-modules.php 8 years ago admin-settings-post-types.php 8 years ago admin-settings-tools.php 8 years ago admin-settings-upgrade.php 8 years ago admin-settings-user-access.php 8 years ago admin-settings-welcome.php 8 years ago admin-settings.php 8 years ago column-css.php 8 years ago column-group.php 8 years ago column-settings.php 8 years ago column.php 8 years ago compatibility.php 8 years ago export-filters.php 8 years ago export.php 8 years ago global-settings.php 8 years ago icon-selector.php 8 years ago jquery.php 8 years ago layout-js-config.php 8 years ago layout-settings.php 8 years ago loop-settings-matching.php 8 years ago module-settings.php 8 years ago module.php 8 years ago row-css.php 8 years ago row-js.php 8 years ago row-settings.php 8 years ago row-video.php 8 years ago row.php 8 years ago strings.php 8 years ago ui-bar-title-area.php 8 years ago ui-bar.php 8 years ago ui-extras.php 8 years ago ui-field-button.php 8 years ago ui-field-code.php 8 years ago ui-field-color.php 8 years ago ui-field-dimension.php 8 years ago ui-field-editor.php 8 years ago ui-field-font.php 8 years ago ui-field-form.php 8 years ago ui-field-icon.php 8 years ago ui-field-layout.php 8 years ago ui-field-link.php 8 years ago ui-field-multiple-audios.php 8 years ago ui-field-multiple-photos.php 8 years ago ui-field-ordering.php 8 years ago ui-field-photo-sizes.php 8 years ago ui-field-photo.php 8 years ago ui-field-post-type.php 8 years ago ui-field-select.php 8 years ago ui-field-suggest.php 8 years ago ui-field-text.php 8 years ago ui-field-textarea.php 8 years ago ui-field-time.php 8 years ago ui-field-timezone.php 8 years ago ui-field-unit.php 8 years ago ui-field-video.php 8 years ago ui-field.php 8 years ago ui-js-config.php 8 years ago ui-js-templates.php 8 years ago ui-legacy-custom-field.php 8 years ago ui-legacy-field.php 8 years ago ui-legacy-settings.php 8 years ago ui-loop-settings.php 8 years ago ui-service-settings.php 8 years ago ui-settings-config.php 8 years ago ui-settings-form-row.php 8 years ago ui-settings-form.php 8 years ago updater-config.php 8 years ago
export.php
455 lines
1 <?php
2 /**
3 * Modified version of the WordPress Export Administration API
4 * that lets us export single posts and selected groups of posts.
5 *
6 * @package WordPress
7 * @subpackage Administration
8 */
9
10 /**
11 * Generates the WXR export file for download.
12 *
13 * @since 2.1.0
14 *
15 * @global wpdb $wpdb
16 * @global WP_Post $post
17 *
18 * @param array $post_ids
19 */
20 function fl_export_wp( $post_ids = array() ) {
21 global $wpdb, $post;
22
23 if ( empty( $post_ids ) ) {
24 return;
25 }
26
27 $sitename = sanitize_key( get_bloginfo( 'name' ) );
28 if ( ! empty( $sitename ) ) {
29 $sitename .= '.';
30 }
31 $date = date( 'Y-m-d' );
32 $wp_filename = $sitename . 'wordpress.' . $date . '.xml';
33 /**
34 * Filter the export filename.
35 *
36 * @since 4.4.0
37 *
38 * @param string $wp_filename The name of the file for download.
39 * @param string $sitename The site name.
40 * @param string $date Today's date, formatted.
41 */
42 $filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename, $date );
43
44 header( 'Content-Description: File Transfer' );
45 header( 'Content-Disposition: attachment; filename=' . $filename );
46 header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
47
48 /**
49 * Wrap given string in XML CDATA tag.
50 *
51 * @since 2.1.0
52 *
53 * @param string $str String to wrap in XML CDATA tag.
54 * @return string
55 */
56 function wxr_cdata( $str ) {
57 if ( ! seems_utf8( $str ) ) {
58 $str = utf8_encode( $str );
59 }
60 // $str = ent2ncr(esc_html($str));
61 $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
62
63 return $str;
64 }
65
66 /**
67 * Return the URL of the site
68 *
69 * @since 2.5.0
70 *
71 * @return string Site URL.
72 */
73 function wxr_site_url() {
74 // Multisite: the base URL.
75 if ( is_multisite() ) {
76 return network_home_url();
77 } // End if().
78 else { return get_bloginfo_rss( 'url' );
79 }
80 }
81
82 /**
83 * Output a cat_name XML tag from a given category object
84 *
85 * @since 2.1.0
86 *
87 * @param object $category Category Object
88 */
89 function wxr_cat_name( $category ) {
90 if ( empty( $category->name ) ) {
91 return;
92 }
93
94 echo '<wp:cat_name>' . wxr_cdata( $category->name ) . '</wp:cat_name>';
95 }
96
97 /**
98 * Output a category_description XML tag from a given category object
99 *
100 * @since 2.1.0
101 *
102 * @param object $category Category Object
103 */
104 function wxr_category_description( $category ) {
105 if ( empty( $category->description ) ) {
106 return;
107 }
108
109 echo '<wp:category_description>' . wxr_cdata( $category->description ) . '</wp:category_description>';
110 }
111
112 /**
113 * Output a tag_name XML tag from a given tag object
114 *
115 * @since 2.3.0
116 *
117 * @param object $tag Tag Object
118 */
119 function wxr_tag_name( $tag ) {
120 if ( empty( $tag->name ) ) {
121 return;
122 }
123
124 echo '<wp:tag_name>' . wxr_cdata( $tag->name ) . '</wp:tag_name>';
125 }
126
127 /**
128 * Output a tag_description XML tag from a given tag object
129 *
130 * @since 2.3.0
131 *
132 * @param object $tag Tag Object
133 */
134 function wxr_tag_description( $tag ) {
135 if ( empty( $tag->description ) ) {
136 return;
137 }
138
139 echo '<wp:tag_description>' . wxr_cdata( $tag->description ) . '</wp:tag_description>';
140 }
141
142 /**
143 * Output a term_name XML tag from a given term object
144 *
145 * @since 2.9.0
146 *
147 * @param object $term Term Object
148 */
149 function wxr_term_name( $term ) {
150 if ( empty( $term->name ) ) {
151 return;
152 }
153
154 echo '<wp:term_name>' . wxr_cdata( $term->name ) . '</wp:term_name>';
155 }
156
157 /**
158 * Output a term_description XML tag from a given term object
159 *
160 * @since 2.9.0
161 *
162 * @param object $term Term Object
163 */
164 function wxr_term_description( $term ) {
165 if ( empty( $term->description ) ) {
166 return;
167 }
168
169 echo '<wp:term_description>' . wxr_cdata( $term->description ) . '</wp:term_description>';
170 }
171
172 /**
173 * Output list of authors with posts
174 *
175 * @since 3.1.0
176 *
177 * @global wpdb $wpdb WordPress database abstraction object.
178 *
179 * @param array $post_ids Array of post IDs to filter the query by. Optional.
180 */
181 function wxr_authors_list( array $post_ids = null ) {
182 global $wpdb;
183
184 if ( ! empty( $post_ids ) ) {
185 $post_ids = array_map( 'absint', $post_ids );
186 $and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';
187 } else {
188 $and = '';
189 }
190
191 $authors = array();
192 // @codingStandardsIgnoreStart
193 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
194 // @codingStandardsIgnoreEnd
195 foreach ( (array) $results as $result ) {
196 $authors[] = get_userdata( $result->post_author );
197 }
198
199 $authors = array_filter( $authors );
200
201 foreach ( $authors as $author ) {
202 echo "\t<wp:author>";
203 echo '<wp:author_id>' . intval( $author->ID ) . '</wp:author_id>';
204 echo '<wp:author_login>' . wxr_cdata( $author->user_login ) . '</wp:author_login>';
205 echo '<wp:author_email>' . wxr_cdata( $author->user_email ) . '</wp:author_email>';
206 echo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';
207 echo '<wp:author_first_name>' . wxr_cdata( $author->first_name ) . '</wp:author_first_name>';
208 echo '<wp:author_last_name>' . wxr_cdata( $author->last_name ) . '</wp:author_last_name>';
209 echo "</wp:author>\n";
210 }
211 }
212
213 /**
214 * Ouput all navigation menu terms
215 *
216 * @since 3.1.0
217 */
218 function wxr_nav_menu_terms() {
219 $nav_menus = wp_get_nav_menus();
220 if ( empty( $nav_menus ) || ! is_array( $nav_menus ) ) {
221 return;
222 }
223
224 foreach ( $nav_menus as $menu ) {
225 echo "\t<wp:term>";
226 echo '<wp:term_id>' . intval( $menu->term_id ) . '</wp:term_id>';
227 echo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';
228 echo '<wp:term_slug>' . wxr_cdata( $menu->slug ) . '</wp:term_slug>';
229 wxr_term_name( $menu );
230 echo "</wp:term>\n";
231 }
232 }
233
234 /**
235 * Output list of taxonomy terms, in XML tag format, associated with a post
236 *
237 * @since 2.3.0
238 */
239 function wxr_post_taxonomy() {
240 $post = get_post();
241
242 $taxonomies = get_object_taxonomies( $post->post_type );
243 if ( empty( $taxonomies ) ) {
244 return;
245 }
246 $terms = wp_get_object_terms( $post->ID, $taxonomies );
247
248 foreach ( (array) $terms as $term ) {
249 echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata( $term->name ) . "</category>\n";
250 }
251 }
252
253 /**
254 *
255 * @param bool $return_me
256 * @param string $meta_key
257 * @return bool
258 */
259 function wxr_filter_postmeta( $return_me, $meta_key ) {
260 if ( '_edit_lock' == $meta_key ) {
261 $return_me = true;
262 }
263 return $return_me;
264 }
265 add_filter( 'wxr_export_skip_postmeta', 'wxr_filter_postmeta', 10, 2 );
266
267 echo '<?xml version="1.0" encoding="' . get_bloginfo( 'charset' ) . "\" ?>\n";
268
269 ?>
270 <!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
271 <!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
272 <!-- You may use this file to transfer that content from one site to another. -->
273 <!-- This file is not intended to serve as a complete backup of your site. -->
274
275 <!-- To import this information into a WordPress site follow these steps: -->
276 <!-- 1. Log in to that site as an administrator. -->
277 <!-- 2. Go to Tools: Import in the WordPress admin panel. -->
278 <!-- 3. Install the "WordPress" importer from the list. -->
279 <!-- 4. Activate & Run Importer. -->
280 <!-- 5. Upload this file using the form provided on that page. -->
281 <!-- 6. You will first be asked to map the authors in this export file to users -->
282 <!-- on the site. For each author, you may choose to map to an -->
283 <!-- existing user on the site or to create a new user. -->
284 <!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
285 <!-- contained in this file into your site. -->
286
287 <?php the_generator( 'export' ); ?>
288 <rss version="2.0"
289 xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
290 xmlns:content="http://purl.org/rss/1.0/modules/content/"
291 xmlns:wfw="http://wellformedweb.org/CommentAPI/"
292 xmlns:dc="http://purl.org/dc/elements/1.1/"
293 xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"
294 >
295
296 <channel>
297 <title><?php bloginfo_rss( 'name' ); ?></title>
298 <link><?php bloginfo_rss( 'url' ); ?></link>
299 <description><?php bloginfo_rss( 'description' ); ?></description>
300 <pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
301 <language><?php bloginfo_rss( 'language' ); ?></language>
302 <wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
303 <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
304 <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
305
306 <?php wxr_authors_list( $post_ids ); ?>
307
308 <?php
309 /** This action is documented in wp-includes/feed-rss2.php */
310 do_action( 'rss2_head' );
311 ?>
312
313 <?php if ( $post_ids ) {
314 /**
315 * @global WP_Query $wp_query
316 */
317 global $wp_query;
318
319 // Fake being in the loop.
320 $wp_query->in_the_loop = true;
321
322 // Fetch 20 posts at a time rather than loading the entire table into memory.
323 while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
324 $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
325 // @codingStandardsIgnoreStart
326 $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
327 // @codingStandardsIgnoreEnd
328
329 // Begin Loop.
330 foreach ( $posts as $post ) {
331 setup_postdata( $post );
332 $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
333 ?>
334 <item>
335 <title><?php
336 /** This filter is documented in wp-includes/feed.php */
337 echo apply_filters( 'the_title_rss', $post->post_title );
338 ?></title>
339 <link><?php the_permalink_rss() ?></link>
340 <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
341 <dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
342 <guid isPermaLink="false"><?php the_guid(); ?></guid>
343 <description></description>
344 <content:encoded><?php
345 /**
346 * Filter the post content used for WXR exports.
347 *
348 * @since 2.5.0
349 *
350 * @param string $post_content Content of the current post.
351 */
352 echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
353 ?></content:encoded>
354 <excerpt:encoded><?php
355 /**
356 * Filter the post excerpt used for WXR exports.
357 *
358 * @since 2.6.0
359 *
360 * @param string $post_excerpt Excerpt for the current post.
361 */
362 echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
363 ?></excerpt:encoded>
364 <wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
365 <wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
366 <wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
367 <wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
368 <wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
369 <wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>
370 <wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>
371 <wp:post_parent><?php echo intval( $post->post_parent ); ?></wp:post_parent>
372 <wp:menu_order><?php echo intval( $post->menu_order ); ?></wp:menu_order>
373 <wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
374 <wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
375 <wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
376 <?php if ( 'attachment' == $post->post_type ) : ?>
377 <wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
378 <?php endif; ?>
379 <?php wxr_post_taxonomy(); ?>
380 <?php $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
381 foreach ( $postmeta as $meta ) :
382 /**
383 * Filter whether to selectively skip post meta used for WXR exports.
384 *
385 * Returning a truthy value to the filter will skip the current meta
386 * object from being exported.
387 *
388 * @since 3.3.0
389 *
390 * @param bool $skip Whether to skip the current post meta. Default false.
391 * @param string $meta_key Current meta key.
392 * @param object $meta Current meta object.
393 */
394 if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
395 continue;
396 }
397 ?>
398 <wp:postmeta>
399 <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
400 <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
401 </wp:postmeta>
402 <?php endforeach;
403
404 $_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
405 $comments = array_map( 'get_comment', $_comments );
406 foreach ( $comments as $c ) : ?>
407 <wp:comment>
408 <wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>
409 <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
410 <wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>
411 <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
412 <wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>
413 <wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>
414 <wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
415 <wp:comment_content><?php echo wxr_cdata( $c->comment_content ) ?></wp:comment_content>
416 <wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>
417 <wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
418 <wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>
419 <wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>
420 <?php $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
421 foreach ( $c_meta as $meta ) :
422 /**
423 * Filter whether to selectively skip comment meta used for WXR exports.
424 *
425 * Returning a truthy value to the filter will skip the current meta
426 * object from being exported.
427 *
428 * @since 4.0.0
429 *
430 * @param bool $skip Whether to skip the current comment meta. Default false.
431 * @param string $meta_key Current meta key.
432 * @param object $meta Current meta object.
433 */
434 if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
435 continue;
436 }
437 ?>
438 <wp:commentmeta>
439 <wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
440 <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
441 </wp:commentmeta>
442 <?php endforeach; ?>
443 </wp:comment>
444 <?php endforeach; ?>
445 </item>
446 <?php
447 }// End foreach().
448 }// End while().
449 }// End if().
450 ?>
451 </channel>
452 </rss>
453 <?php
454 }
455