| @@ -18,9 +18,9 @@ | ||
| 18 | 18 | global $wp_query; |
| 19 | 19 | // Fake being in the loop. |
| 20 | 20 | $wp_query->in_the_loop = true; |
| 21 | 21 | |
| 22 | -// fetch 20 posts at a time rather than loading the entire table into memory | |
| 22 | +// Fetch 20 posts at a time rather than loading the entire table into memory | |
| 23 | 23 | while ( $next_posts = array_splice( $item_ids, 0, 20 ) ) { |
| 24 | 24 | $posts = FrmDb::get_results( $wpdb->posts, array( 'ID' => $next_posts ) ); |
| 25 | 25 | |
| 26 | 26 | // Begin Loop |
| @@ -52,8 +52,9 @@ | ||
| 52 | 52 | <?php |
| 53 | 53 | endif; |
| 54 | 54 | |
| 55 | 55 | $postmeta = FrmDb::get_results( $wpdb->postmeta, array( 'post_id' => $post->ID ) ); |
| 56 | + | |
| 56 | 57 | foreach ( $postmeta as $meta ) : |
| 57 | 58 | if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) { |
| 58 | 59 | continue; |
| 59 | 60 | } |
| @@ -65,9 +66,10 @@ | ||
| 65 | 66 | <?php |
| 66 | 67 | endforeach; |
| 67 | 68 | |
| 68 | 69 | $taxonomies = get_object_taxonomies( $post->post_type ); |
| 69 | - if ( ! empty( $taxonomies ) ) { | |
| 70 | + | |
| 71 | + if ( $taxonomies ) { | |
| 70 | 72 | $terms = wp_get_object_terms( $post->ID, $taxonomies ); |
| 71 | 73 | |
| 72 | 74 | foreach ( (array) $terms as $term ) { |
| 73 | 75 | ?> |
| @@ -77,8 +79,9 @@ | ||
| 77 | 79 | } |
| 78 | 80 | |
| 79 | 81 | if ( 'frm_display' === $post->post_type && is_callable( 'FrmViewsLayout::get_layouts_for_view' ) ) { |
| 80 | 82 | $layouts = FrmViewsLayout::get_layouts_for_view( $post->ID ); |
| 83 | + | |
| 81 | 84 | if ( is_array( $layouts ) ) { |
| 82 | 85 | foreach ( $layouts as $layout ) { |
| 83 | 86 | ?> |
| 84 | 87 | <layout> |
| @@ -99,9 +102,10 @@ | ||
| 99 | 102 | return; |
| 100 | 103 | } |
| 101 | 104 | |
| 102 | 105 | global $frm_inc_tax; |
| 103 | -if ( empty( $frm_inc_tax ) ) { | |
| 106 | + | |
| 107 | +if ( ! $frm_inc_tax ) { | |
| 104 | 108 | $frm_inc_tax = array(); |
| 105 | 109 | } |
| 106 | 110 | |
| 107 | 111 | $parent_slugs = FrmXMLController::get_parent_terms_slugs( $terms ); |
| @@ -111,17 +115,18 @@ | ||
| 111 | 115 | continue; |
| 112 | 116 | } |
| 113 | 117 | |
| 114 | 118 | $frm_inc_tax[] = $term->term_id; |
| 115 | - $label = 'category' === $term->taxonomy || 'tag' === $term->taxonomy ? $term->taxonomy : 'term'; | |
| 116 | 119 | ?> |
| 117 | 120 | <term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php |
| 118 | 121 | if ( ! empty( $parent_slugs[ $term->parent ] ) ) { |
| 119 | 122 | echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>'; |
| 120 | 123 | } |
| 124 | + | |
| 121 | 125 | if ( ! empty( $term->name ) ) { |
| 122 | 126 | echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 123 | 127 | } |
| 128 | + | |
| 124 | 129 | if ( ! empty( $term->description ) ) { |
| 125 | 130 | echo '<term_description>' . FrmXMLHelper::cdata( $term->description ) . '</term_description>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 126 | 131 | } |
| 127 | 132 | echo '<term_slug>' . esc_html( $term->slug ) . '</term_slug>'; |