- <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
- <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
- <wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
- <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
- <wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
- <wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
- <wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
- <wp:comment_content><?php echo wxr_cdata( $c->comment_content ) ?></wp:comment_content>
- <wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
- <wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
- <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
- <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
+ <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
+ <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
+ <wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
+ <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
+ <wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
+ <wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
+ <wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
+ <wp:comment_content><?php echo wxr_cdata( $c->comment_content ) ?></wp:comment_content>
+ <wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
+ <wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
+ <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
+ <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
+<?php $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
+ foreach ( $c_meta as $meta ) :
+ /**
+ * Filter whether to selectively skip comment meta used for WXR exports.
+ *
+ * Returning a truthy value to the filter will skip the current meta
+ * object from being exported.
+ *
+ * @since 4.0.0
+ *
+ * @param bool $skip Whether to skip the current comment meta. Default false.
+ * @param string $meta_key Current meta key.
+ * @param object $meta Current meta object.
+ */
+ if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
+ continue;
+ }
+ ?>
+ <wp:commentmeta>
+ <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
+ </wp:commentmeta>
+<?php endforeach; ?>