Filter hook 'wxr_export_skip_postmeta'

in WP Core File wp-admin/includes/export.php at line 669

View Source

wxr_export_skip_postmeta

Filter Hook
Description
Filters whether to selectively skip post meta used for WXR exports. Returning a truthy value from the filter will skip the current meta object from being exported.

Hook Information

File Location wp-admin/includes/export.php View on GitHub
Hook Type Filter
Line Number 669

Hook Parameters

Type Name Description
bool $skip Whether to skip the current post meta. Default false.
string $meta_key Current meta key.
object $meta Current meta object.

Usage Examples

Basic Usage
<?php
// Hook into wxr_export_skip_postmeta
add_filter('wxr_export_skip_postmeta', 'my_custom_filter', 10, 3);

function my_custom_filter($skip, $meta_key, $meta) {
    // Your custom filtering logic here
    return $skip;
}

Source Code Context

wp-admin/includes/export.php:669 - How this hook is used in WordPress core
<?php
 664  					 *
 665  					 * @param bool   $skip     Whether to skip the current post meta. Default false.
 666  					 * @param string $meta_key Current meta key.
 667  					 * @param object $meta     Current meta object.
 668  					 */
 669  					if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
 670  						continue;
 671  					}
 672  					?>
 673  		<wp:postmeta>
 674  		<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>

PHP Documentation

<?php
/**
					 * Filters whether to selectively skip post meta used for WXR exports.
					 *
					 * Returning a truthy value from the filter will skip the current meta
					 * object from being exported.
					 *
					 * @since 3.3.0
					 *
					 * @param bool   $skip     Whether to skip the current post meta. Default false.
					 * @param string $meta_key Current meta key.
					 * @param object $meta     Current meta object.
					 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-admin/includes/export.php
Related Hooks

Related hooks will be displayed here in future updates.