PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.3.1
Kubio AI Page Builder v2.3.1
2.9.1 2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / src / DemoSites / WXRExporter.php
kubio / lib / src / DemoSites Last commit date
DemoSites.php 2 years ago DemoSitesHelpers.php 2 years ago DemoSitesImportBlockMap.php 4 years ago DemoSitesImporter.php 2 years ago DemoSitesLogger.php 4 years ago DemoSitesRepository.php 2 years ago WXRExporter.php 4 years ago WXRImporter.php 2 years ago
WXRExporter.php
611 lines
1 <?php
2
3 // phpcs:disable WordPress.Security.EscapeOutput
4 // the escaping rule is disabled as the WXR generation require the raw database content
5
6 namespace Kubio\DemoSites;
7
8 class WXRExporter {
9
10 const WXR_VERSION = '1.2';
11
12 public static function export( $args = array() ) {
13 global $wpdb;
14
15 $defaults = array(
16 'content' => 'all',
17 'author' => false,
18 'category' => false,
19 'start_date' => false,
20 'end_date' => false,
21 'status' => false,
22 );
23 $args = wp_parse_args( $args, $defaults );
24
25 $post_types = get_post_types( array( 'can_export' => true ) );
26
27 // remove colibri post types
28 foreach ( $post_types as $key => $post_type ) {
29 if ( strpos( $post_type, 'extb_post_' ) === 0 ) {
30 unset( $post_types[ $key ] );
31 }
32 }
33
34 $esses = array_fill( 0, count( $post_types ), '%s' );
35
36 // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
37 $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (" . implode( ',', $esses ) . ')', $post_types );
38
39 if ( $args['status'] && ( 'post' === $args['content'] || 'page' === $args['content'] ) ) {
40 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_status = %s", $args['status'] );
41 } else {
42 $where .= " AND {$wpdb->posts}.post_status != 'auto-draft'";
43 }
44
45 $join = '';
46 if ( $args['category'] && 'post' === $args['content'] ) {
47 $term = term_exists( $args['category'], 'category' );
48 if ( $term ) {
49 $join = "INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
50 $where .= $wpdb->prepare( " AND {$wpdb->term_relationships}.term_taxonomy_id = %d", $term['term_taxonomy_id'] );
51 }
52 }
53
54 if ( in_array( $args['content'], array( 'post', 'page', 'attachment' ), true ) ) {
55 if ( $args['author'] ) {
56 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] );
57 }
58
59 if ( $args['start_date'] ) {
60 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date >= %s", gmdate( 'Y-m-d', strtotime( $args['start_date'] ) ) );
61 }
62
63 if ( $args['end_date'] ) {
64 $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date < %s", gmdate( 'Y-m-d', strtotime( '+1 month', strtotime( $args['end_date'] ) ) ) );
65 }
66 }
67
68 // Grab a snapshot of post IDs, just in case it changes during the export.
69 $post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
70
71 $cats = array();
72 $tags = array();
73 $terms = array();
74 if ( isset( $term ) && $term ) {
75 $cat = get_term( $term['term_id'], 'category' );
76 $cats = array( $cat->term_id => $cat );
77 unset( $term, $cat );
78 } elseif ( 'all' === $args['content'] ) {
79 $categories = (array) get_categories( array( 'get' => 'all' ) );
80 $tags = (array) get_tags( array( 'get' => 'all' ) );
81
82 $custom_taxonomies = get_taxonomies( array( '_builtin' => false ) );
83 $custom_terms = (array) get_terms(
84 array(
85 'taxonomy' => $custom_taxonomies,
86 'get' => 'all',
87 )
88 );
89
90 // Put categories in order with no child going before its parent.
91 while ( $cat = array_shift( $categories ) ) {
92 if ( ! $cat->parent || isset( $cats[ $cat->parent ] ) ) {
93 $cats[ $cat->term_id ] = $cat;
94 } else {
95 $categories[] = $cat;
96 }
97 }
98
99 // Put terms in order with no child going before its parent.
100 while ( $t = array_shift( $custom_terms ) ) {
101 if ( ! $t->parent || isset( $terms[ $t->parent ] ) ) {
102 $terms[ $t->term_id ] = $t;
103 } else {
104 $custom_terms[] = $t;
105 }
106 }
107
108 unset( $categories, $custom_taxonomies, $custom_terms );
109 }
110
111 add_filter( 'wxr_export_skip_postmeta', array( WXRExporter::class, 'skipPostMeta' ), 10, 2 );
112
113 $content = static::getContent( $post_ids, $cats, $tags, $terms );
114
115 remove_filter( 'wxr_export_skip_postmeta', array( WXRExporter::class, 'skipPostMeta' ) );
116
117 return trim( $content );
118 }
119
120 private static function getContent( $post_ids, $cats, $tags, $terms ) {
121 global $wpdb;
122 ob_start(); ?>
123
124 <?php the_generator( 'export' ); ?>
125 <rss version="2.0"
126 xmlns:excerpt="http://wordpress.org/export/<?php echo WXRExporter::WXR_VERSION; ?>/excerpt/"
127 xmlns:content="http://purl.org/rss/1.0/modules/content/"
128 xmlns:dc="http://purl.org/dc/elements/1.1/"
129 xmlns:wp="http://wordpress.org/export/<?php echo WXRExporter::WXR_VERSION; ?>/"
130 >
131
132 <channel>
133 <title><?php bloginfo_rss( 'name' ); ?></title>
134 <link><?php bloginfo_rss( 'url' ); ?></link>
135 <description><?php bloginfo_rss( 'description' ); ?></description>
136 <pubDate><?php echo gmdate( 'D, d M Y H:i:s +0000' ); ?></pubDate>
137 <language><?php bloginfo_rss( 'language' ); ?></language>
138 <wp:wxr_version><?php echo WXRExporter::WXR_VERSION; ?></wp:wxr_version>
139 <wp:base_site_url><?php echo static::getSiteURL(); ?></wp:base_site_url>
140 <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
141
142 <?php static::printAuthorsList( $post_ids ); ?>
143
144 <?php foreach ( $cats as $c ) : ?>
145 <wp:category>
146 <wp:term_id><?php echo (int) $c->term_id; ?></wp:term_id>
147 <wp:category_nicename><?php echo static::getCData( $c->slug ); ?></wp:category_nicename>
148 <wp:category_parent><?php echo static::getCData( $c->parent ? $cats[ $c->parent ]->slug : '' ); ?></wp:category_parent>
149 <?php
150 static::printCatName( $c );
151 static::printCatDescription( $c );
152 static::printTermMeta( $c );
153 ?>
154 </wp:category>
155 <?php endforeach; ?>
156 <?php foreach ( $tags as $t ) : ?>
157 <wp:tag>
158 <wp:term_id><?php echo (int) $t->term_id; ?></wp:term_id>
159 <wp:tag_slug><?php echo static::getCData( $t->slug ); ?></wp:tag_slug>
160 <?php
161 static::printTagName( $t );
162 static::printTagDescription( $t );
163 static::printTermMeta( $t );
164 ?>
165 </wp:tag>
166 <?php endforeach; ?>
167 <?php foreach ( $terms as $t ) : ?>
168 <wp:term>
169 <wp:term_id><?php echo (int) $t->term_id; ?></wp:term_id>
170 <wp:term_taxonomy><?php echo static::getCData( $t->taxonomy ); ?></wp:term_taxonomy>
171 <wp:term_slug><?php echo static::getCData( $t->slug ); ?></wp:term_slug>
172 <wp:term_parent><?php echo static::getCData( $t->parent ? $terms[ $t->parent ]->slug : '' ); ?></wp:term_parent>
173 <?php
174 static::printTermName( $t );
175 static::printTermDescription( $t );
176 static::printTermMeta( $t );
177 ?>
178 </wp:term>
179 <?php endforeach; ?>
180 <?php static::printNavTerms(); ?>
181
182 <?php
183 /** This action is documented in wp-includes/feed-rss2.php */
184 do_action( 'rss2_head' );
185 ?>
186
187 <?php
188 if ( $post_ids ) {
189 /**
190 * @global WP_Query $wp_query WordPress Query object.
191 */
192 global $wp_query;
193
194 // Fake being in the loop.
195 $wp_query->in_the_loop = true;
196
197 // Fetch 20 posts at a time rather than loading the entire table into memory.
198 while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
199 $where = 'WHERE ID IN (' . implode( ',', $next_posts ) . ')';
200 $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
201
202 // Begin Loop.
203 foreach ( $posts as $post ) {
204 setup_postdata( $post );
205
206 /**
207 * Filters the post title used for WXR exports.
208 *
209 * @param string $post_title Title of the current post.
210 *
211 * @since 5.7.0
212 *
213 */
214 $title = static::getCData( apply_filters( 'the_title_export', $post->post_title ) );
215
216 /**
217 * Filters the post content used for WXR exports.
218 *
219 * @param string $post_content Content of the current post.
220 *
221 * @since 2.5.0
222 *
223 */
224 $content = static::getCData( apply_filters( 'the_content_export', $post->post_content ) );
225
226 /**
227 * Filters the post excerpt used for WXR exports.
228 *
229 * @param string $post_excerpt Excerpt for the current post.
230 *
231 * @since 2.6.0
232 *
233 */
234 $excerpt = static::getCData( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
235
236 $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
237 ?>
238 <item>
239 <title><?php echo $title; ?></title>
240 <link><?php the_permalink_rss(); ?></link>
241 <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
242 <dc:creator><?php echo static::getCData( get_the_author_meta( 'login' ) ); ?></dc:creator>
243 <guid isPermaLink="false"><?php the_guid(); ?></guid>
244 <description></description>
245 <content:encoded><?php echo $content; ?></content:encoded>
246 <excerpt:encoded><?php echo $excerpt; ?></excerpt:encoded>
247 <wp:post_id><?php echo (int) $post->ID; ?></wp:post_id>
248 <wp:post_date><?php echo static::getCData( $post->post_date ); ?></wp:post_date>
249 <wp:post_date_gmt><?php echo static::getCData( $post->post_date_gmt ); ?></wp:post_date_gmt>
250 <wp:post_modified><?php echo static::getCData( $post->post_modified ); ?></wp:post_modified>
251 <wp:post_modified_gmt><?php echo static::getCData( $post->post_modified_gmt ); ?></wp:post_modified_gmt>
252 <wp:comment_status><?php echo static::getCData( $post->comment_status ); ?></wp:comment_status>
253 <wp:ping_status><?php echo static::getCData( $post->ping_status ); ?></wp:ping_status>
254 <wp:post_name><?php echo static::getCData( $post->post_name ); ?></wp:post_name>
255 <wp:status><?php echo static::getCData( $post->post_status ); ?></wp:status>
256 <wp:post_parent><?php echo (int) $post->post_parent; ?></wp:post_parent>
257 <wp:menu_order><?php echo (int) $post->menu_order; ?></wp:menu_order>
258 <wp:post_type><?php echo static::getCData( $post->post_type ); ?></wp:post_type>
259 <wp:post_password><?php echo static::getCData( $post->post_password ); ?></wp:post_password>
260 <wp:is_sticky><?php echo (int) $is_sticky; ?></wp:is_sticky>
261 <?php if ( 'attachment' === $post->post_type ) : ?>
262 <wp:attachment_url><?php echo static::getCData( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
263 <?php endif; ?>
264 <?php static::printPostTaxonomy( $post ); ?>
265 <?php
266 $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
267 foreach ( $postmeta as $meta ) :
268 /**
269 * Filters whether to selectively skip post meta used for WXR exports.
270 *
271 * Returning a truthy value from the filter will skip the current meta
272 * object from being exported.
273 *
274 * @param bool $skip Whether to skip the current post meta. Default false.
275 * @param string $meta_key Current meta key.
276 * @param object $meta Current meta object.
277 *
278 * @since 3.3.0
279 *
280 */
281 if ( ! apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
282 ?>
283 <wp:postmeta>
284 <wp:meta_key><?php echo static::getCData( $meta->meta_key ); ?></wp:meta_key>
285 <wp:meta_value><?php echo static::getCData( $meta->meta_value ); ?></wp:meta_value>
286 </wp:postmeta>
287 <?php
288 }
289
290 endforeach;
291
292 $_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
293 $comments = array_map( 'get_comment', $_comments );
294 foreach ( $comments as $c ) :
295 ?>
296 <wp:comment>
297 <wp:comment_id><?php echo (int) $c->comment_ID; ?></wp:comment_id>
298 <wp:comment_author><?php echo static::getCData( $c->comment_author ); ?></wp:comment_author>
299 <wp:comment_author_email><?php echo static::getCData( $c->comment_author_email ); ?></wp:comment_author_email>
300 <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
301 <wp:comment_author_IP><?php echo static::getCData( $c->comment_author_IP ); ?></wp:comment_author_IP>
302 <wp:comment_date><?php echo static::getCData( $c->comment_date ); ?></wp:comment_date>
303 <wp:comment_date_gmt><?php echo static::getCData( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
304 <wp:comment_content><?php echo static::getCData( $c->comment_content ); ?></wp:comment_content>
305 <wp:comment_approved><?php echo static::getCData( $c->comment_approved ); ?></wp:comment_approved>
306 <wp:comment_type><?php echo static::getCData( $c->comment_type ); ?></wp:comment_type>
307 <wp:comment_parent><?php echo (int) $c->comment_parent; ?></wp:comment_parent>
308 <wp:comment_user_id><?php echo (int) $c->user_id; ?></wp:comment_user_id>
309 <?php
310 $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
311 foreach ( $c_meta as $meta ) :
312 /**
313 * Filters whether to selectively skip comment meta used for WXR exports.
314 *
315 * Returning a truthy value from the filter will skip the current meta
316 * object from being exported.
317 *
318 * @param bool $skip Whether to skip the current comment meta. Default false.
319 * @param string $meta_key Current meta key.
320 * @param object $meta Current meta object.
321 *
322 * @since 4.0.0
323 *
324 */
325 if ( apply_filters( 'static::wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
326 continue;
327 }
328 ?>
329 <wp:commentmeta>
330 <wp:meta_key><?php echo static::getCData( $meta->meta_key ); ?></wp:meta_key>
331 <wp:meta_value><?php echo static::getCData( $meta->meta_value ); ?></wp:meta_value>
332 </wp:commentmeta>
333 <?php endforeach; ?>
334 </wp:comment>
335 <?php endforeach; ?>
336 </item>
337 <?php
338 }
339 }
340 }
341 ?>
342 </channel>
343 </rss>
344 <?php
345
346 return ob_get_clean();
347 }
348
349 /**
350 * Return the URL of the site
351 *
352 * @return string Site URL.
353 * @since 2.5.0
354 *
355 */
356 public static function getSiteURL() {
357 if ( is_multisite() ) {
358 // Multisite: the base URL.
359 return network_home_url();
360 } else {
361 // WordPress (single site): the blog URL.
362 return get_bloginfo_rss( 'url' );
363 }
364 }
365
366 /**
367 * Output list of authors with posts
368 *
369 * @param int[] $post_ids Optional. Array of post IDs to filter the query by.
370 *
371 * @global wpdb $wpdb WordPress database abstraction object.
372 *
373 * @since 3.1.0
374 *
375 */
376 private static function printAuthorsList( array $post_ids = null ) {
377 global $wpdb;
378
379 if ( ! empty( $post_ids ) ) {
380 $post_ids = array_map( 'absint', $post_ids );
381 $and = 'AND ID IN ( ' . implode( ', ', $post_ids ) . ')';
382 } else {
383 $and = '';
384 }
385
386 $authors = array();
387 $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft' $and" );
388 foreach ( (array) $results as $result ) {
389 $authors[] = get_userdata( $result->post_author );
390 }
391
392 $authors = array_filter( $authors );
393
394 foreach ( $authors as $author ) {
395 echo "\t<wp:author>";
396 echo '<wp:author_id>' . (int) $author->ID . '</wp:author_id>';
397 echo '<wp:author_login>' . static::getCData( $author->user_login ) . '</wp:author_login>';
398 echo '<wp:author_email>' . static::getCData( $author->user_email ) . '</wp:author_email>';
399 echo '<wp:author_display_name>' . static::getCData( $author->display_name ) . '</wp:author_display_name>';
400 echo '<wp:author_first_name>' . static::getCData( $author->first_name ) . '</wp:author_first_name>';
401 echo '<wp:author_last_name>' . static::getCData( $author->last_name ) . '</wp:author_last_name>';
402 echo "</wp:author>\n";
403 }
404 }
405
406 /**
407 * Wrap given string in XML CDATA tag.
408 *
409 * @param string $str String to wrap in XML CDATA tag.
410 *
411 * @return string
412 * @since 2.1.0
413 *
414 */
415 private static function getCData( $str ) {
416 if ( ! seems_utf8( $str ) ) {
417 $str = utf8_encode( $str );
418 }
419
420 $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
421
422 return $str;
423 }
424
425 /**
426 * Output a cat_name XML tag from a given category object
427 *
428 * @param WP_Term $category Category Object
429 *
430 * @since 2.1.0
431 *
432 */
433 private static function printCatName( $category ) {
434 if ( empty( $category->name ) ) {
435 return;
436 }
437
438 echo '<wp:cat_name>' . static::getCData( $category->name ) . "</wp:cat_name>\n";
439 }
440
441 /**
442 * Output a category_description XML tag from a given category object
443 *
444 * @param WP_Term $category Category Object
445 *
446 * @since 2.1.0
447 *
448 */
449 private static function printCatDescription( $category ) {
450 if ( empty( $category->description ) ) {
451 return;
452 }
453
454 echo '<wp:category_description>' . static::getCData( $category->description ) . "</wp:category_description>\n";
455 }
456
457 /**
458 * Output term meta XML tags for a given term object.
459 *
460 * @param WP_Term $term Term object.
461 *
462 * @since 4.6.0
463 *
464 */
465 private static function printTermMeta( $term ) {
466 global $wpdb;
467
468 $termmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->termmeta WHERE term_id = %d", $term->term_id ) );
469
470 foreach ( $termmeta as $meta ) {
471 /**
472 * Filters whether to selectively skip term meta used for WXR exports.
473 *
474 * Returning a truthy value from the filter will skip the current meta
475 * object from being exported.
476 *
477 * @param bool $skip Whether to skip the current piece of term meta. Default false.
478 * @param string $meta_key Current meta key.
479 * @param object $meta Current meta object.
480 *
481 * @since 4.6.0
482 *
483 */
484 if ( ! apply_filters( 'wxr_export_skip_termmeta', false, $meta->meta_key, $meta ) ) {
485 printf( "\t\t<wp:termmeta>\n\t\t\t<wp:meta_key>%s</wp:meta_key>\n\t\t\t<wp:meta_value>%s</wp:meta_value>\n\t\t</wp:termmeta>\n", wxr_cdata( $meta->meta_key ), wxr_cdata( $meta->meta_value ) );
486 }
487 }
488 }
489
490 /**
491 * Output a tag_name XML tag from a given tag object
492 *
493 * @param WP_Term $tag Tag Object
494 *
495 * @since 2.3.0
496 *
497 */
498 private static function printTagName( $tag ) {
499 if ( empty( $tag->name ) ) {
500 return;
501 }
502
503 echo '<wp:tag_name>' . static::getCData( $tag->name ) . "</wp:tag_name>\n";
504 }
505
506 /**
507 * Output a tag_description XML tag from a given tag object
508 *
509 * @param WP_Term $tag Tag Object
510 *
511 * @since 2.3.0
512 *
513 */
514 private static function printTagDescription( $tag ) {
515 if ( empty( $tag->description ) ) {
516 return;
517 }
518
519 echo '<wp:tag_description>' . static::getCData( $tag->description ) . "</wp:tag_description>\n";
520 }
521
522 /**
523 * Output a term_name XML tag from a given term object
524 *
525 * @param WP_Term $term Term Object
526 *
527 * @since 2.9.0
528 *
529 */
530 private static function printTermName( $term ) {
531 if ( empty( $term->name ) ) {
532 return;
533 }
534
535 echo '<wp:term_name>' . static::getCData( $term->name ) . "</wp:term_name>\n";
536 }
537
538 /**
539 * Output a term_description XML tag from a given term object
540 *
541 * @param WP_Term $term Term Object
542 *
543 * @since 2.9.0
544 *
545 */
546 private static function printTermDescription( $term ) {
547 if ( empty( $term->description ) ) {
548 return;
549 }
550
551 echo "\t\t<wp:term_description>" . static::getCData( $term->description ) . "</wp:term_description>\n";
552 }
553
554 /**
555 * Output all navigation menu terms
556 *
557 * @since 3.1.0
558 */
559 private static function printNavTerms() {
560 $nav_menus = wp_get_nav_menus();
561 if ( empty( $nav_menus ) || ! is_array( $nav_menus ) ) {
562 return;
563 }
564
565 foreach ( $nav_menus as $menu ) {
566 echo "\t<wp:term>";
567 echo '<wp:term_id>' . (int) $menu->term_id . '</wp:term_id>';
568 echo '<wp:term_taxonomy>nav_menu</wp:term_taxonomy>';
569 echo '<wp:term_slug>' . static::getCData( $menu->slug ) . '</wp:term_slug>';
570 static::printTermName( $menu );
571 echo "</wp:term>\n";
572 }
573 }
574
575 /**
576 * Output list of taxonomy terms, in XML tag format, associated with a post
577 *
578 * @since 2.3.0
579 */
580 private static function printPostTaxonomy( $post ) {
581
582 $taxonomies = get_object_taxonomies( $post->post_type );
583 if ( empty( $taxonomies ) ) {
584 return;
585 }
586 $terms = wp_get_object_terms( $post->ID, $taxonomies );
587
588 foreach ( (array) $terms as $term ) {
589 echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . static::getCData( $term->name ) . "</category>\n";
590 }
591 }
592
593 /**
594 * @param bool $return_me
595 * @param string $meta_key
596 *
597 * @return bool
598 */
599 public static function skipPostMeta( $return_me, $meta_key ) {
600
601 $skipped = array( '_edit_lock', 'extend_builder' );
602
603 if ( in_array( $meta_key, $skipped ) ) {
604 $return_me = true;
605 }
606
607 return $return_me;
608 }
609
610 }
611