diff --git a/src/wp-admin/includes/export.php b/src/wp-admin/includes/export.php index 67bf931b63..397e9e7a03 100644 --- a/src/wp-admin/includes/export.php +++ b/src/wp-admin/includes/export.php @@ -473,7 +473,23 @@ function export_wp( $args = array() ) { comment_parent; ?> user_id; ?> get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) ); - foreach ( $c_meta as $meta ) : ?> + 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; + } + ?> meta_key; ?> meta_value ); ?>