PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 3.06.06
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v3.06.06
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / xml / posts_xml.php

posts_xml.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 3.06.06, at classes/views/xml/posts_xml.php

99 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! $item_ids ) {
4 return;
5 }
6
7 global $wp_query;
8 $wp_query->in_the_loop = true; // Fake being in the loop.
9
10 // fetch 20 posts at a time rather than loading the entire table into memory
11 while ( $next_posts = array_splice( $item_ids, 0, 20 ) ) {
12 $posts = FrmDb::get_results( $wpdb->posts, array( 'ID' => $next_posts ) );
13
14 // Begin Loop
15 foreach ( $posts as $post ) {
16 setup_postdata( $post );
17 $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
18 ?>
19 <view>
20 <title><?php echo esc_html( apply_filters( 'the_title_rss', $post->post_title ) ); ?></title>
21 <link><?php the_permalink_rss() ?></link>
22 <post_author><?php echo FrmXMLHelper::cdata( get_the_author_meta( 'login' ) ); // WPCS: XSS ok. ?></post_author>
23 <description></description>
24 <content><?php echo FrmXMLHelper::cdata( apply_filters( 'the_content_export', $post->post_content ) ); // WPCS: XSS ok. ?></content>
25 <excerpt><?php echo FrmXMLHelper::cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) ); // WPCS: XSS ok. ?></excerpt>
26 <post_id><?php echo esc_html( $post->ID ); ?></post_id>
27 <post_date><?php echo esc_html( $post->post_date ); ?></post_date>
28 <post_date_gmt><?php echo esc_html( $post->post_date_gmt ); ?></post_date_gmt>
29 <comment_status><?php echo esc_html( $post->comment_status ); ?></comment_status>
30 <ping_status><?php echo esc_html( $post->ping_status ); ?></ping_status>
31 <post_name><?php echo esc_html( $post->post_name ); ?></post_name>
32 <status><?php echo esc_html( $post->post_status ); ?></status>
33 <post_parent><?php echo esc_html( $post->post_parent ); ?></post_parent>
34 <menu_order><?php echo esc_html( $post->menu_order ); ?></menu_order>
35 <post_type><?php echo esc_html( $post->post_type ); ?></post_type>
36 <post_password><?php echo FrmXMLHelper::cdata( $post->post_password ); // WPCS: XSS ok. ?></post_password>
37 <is_sticky><?php echo esc_html( $is_sticky ); ?></is_sticky>
38 <?php if ( 'attachment' === $post->post_type ) : ?>
39 <attachment_url><?php echo esc_url( wp_get_attachment_url( $post->ID ) ); ?></attachment_url>
40 <?php
41 endif;
42
43 $postmeta = FrmDb::get_results( $wpdb->postmeta, array( 'post_id' => $post->ID ) );
44 foreach ( $postmeta as $meta ) :
45 if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
46 continue;
47 }
48 ?>
49 <postmeta>
50 <meta_key><?php echo esc_html( $meta->meta_key ); ?></meta_key>
51 <meta_value><?php echo FrmXMLHelper::cdata( $meta->meta_value ); // WPCS: XSS ok. ?></meta_value>
52 </postmeta>
53 <?php
54 endforeach;
55
56 $taxonomies = get_object_taxonomies( $post->post_type );
57 if ( ! empty( $taxonomies ) ) {
58 $terms = wp_get_object_terms( $post->ID, $taxonomies );
59
60 foreach ( (array) $terms as $term ) {
61 ?>
62 <category domain="<?php echo esc_attr( $term->taxonomy ) ?>" nicename="<?php echo esc_attr( $term->slug ) ?>"><?php echo FrmXMLHelper::cdata( $term->name ); // WPCS: XSS ok. ?></category>
63 <?php
64 }
65 }
66 ?>
67 </view>
68 <?php
69 }
70 }
71
72 if ( empty( $taxonomies ) ) {
73 return;
74 }
75
76 global $frm_inc_tax;
77 if ( empty( $frm_inc_tax ) ) {
78 $frm_inc_tax = array();
79 }
80
81 foreach ( (array) $terms as $term ) {
82 if ( in_array( $term->term_id, $frm_inc_tax, true ) ) {
83 return;
84 }
85
86 $frm_inc_tax[] = $term->term_id;
87 $label = ( 'category' === $term->taxonomy || 'tag' === $term->taxonomy ) ? $term->taxonomy : 'term';
88 ?>
89 <term><term_id><?php echo esc_html( $term->term_id ) ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php
90 if ( ! empty( $term->name ) ) {
91 echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // WPCS: XSS ok.
92 }
93 if ( ! empty( $term->description ) ) {
94 echo '<term_description>' . FrmXMLHelper::cdata( $term->description ) . '</term_description>'; // WPCS: XSS ok.
95 }
96 echo '<term_slug>' . esc_html( $term->slug ) . '</term_slug>';
97 echo '</term>';
98 }
99