From d395f6411734c02525c281022cefd9e3b1e42db9 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 22 Aug 2014 01:47:59 +0000 Subject: [PATCH] Export: Add wxr_export_skip_commentmeta filter to match the _postmeta filter. props cfinke. fixes #28745. git-svn-id: https://develop.svn.wordpress.org/trunk@29573 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/export.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 ); ?>