Ticket #28745: wxr_export_skip_commentmeta.patch
| File wxr_export_skip_commentmeta.patch, 1.2 KB (added by , 12 years ago) |
|---|
-
wp-admin/includes/export.php
468 468 <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent> 469 469 <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id> 470 470 <?php $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) ); 471 foreach ( $c_meta as $meta ) : ?> 471 foreach ( $c_meta as $meta ) : 472 /** 473 * Filter whether to selectively skip comment meta used for WXR exports. 474 * 475 * Returning a truthy value to the filter will skip the current meta 476 * object from being exported. 477 * 478 * @param bool $skip Whether to skip the current comment meta. Default false. 479 * @param string $meta_key Current meta key. 480 * @param object $meta Current meta object. 481 */ 482 if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) { 483 continue; 484 } 485 ?> 472 486 <wp:commentmeta> 473 487 <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key> 474 488 <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>