WordPress.org

Make WordPress Core

Changeset 29573


Ignore:
Timestamp:
08/22/2014 01:47:59 AM (7 years ago)
Author:
nacin
Message:

Export: Add wxr_export_skip_commentmeta filter to match the _postmeta filter.

props cfinke.
fixes #28745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/export.php

    r29206 r29573  
    474474            <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
    475475<?php       $c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
    476             foreach ( $c_meta as $meta ) : ?>
     476            foreach ( $c_meta as $meta ) :
     477                /**
     478                 * Filter whether to selectively skip comment meta used for WXR exports.
     479                 *
     480                 * Returning a truthy value to the filter will skip the current meta
     481                 * object from being exported.
     482                 *
     483                 * @since 4.0.0
     484                 *
     485                 * @param bool   $skip     Whether to skip the current comment meta. Default false.
     486                 * @param string $meta_key Current meta key.
     487                 * @param object $meta     Current meta object.
     488                 */
     489                if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
     490                    continue;
     491                }
     492            ?>
    477493            <wp:commentmeta>
    478494                <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
Note: See TracChangeset for help on using the changeset viewer.