Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions inc/xposts.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ function __construct() {
// Don't let xposts participate in resolved/unresolved
add_filter( 'o2_resolved_posts_maybe_mark_new_as_unresolved', array( $this, 'o2rpx_dont_mark_xposts' ), 10, 2 );

// Duplicate Posts: don't copy xpost metadata with the post.
add_filter( 'duplicate_post_excludelist_filter', array( $this, 'duplicate_post_excludelist_filter' ) );

parent::__construct( 'xposts' );
}

Expand Down Expand Up @@ -606,6 +609,15 @@ function o2rpx_dont_mark_xposts( $true, $post ) {

return $true;
}

/* Don't copy xpost-related metadata when cloning posts. */
function duplicate_post_excludelist_filter( $metadata ) {
// Don't copy xpost metadata with the post.
$metadata[] = 'xpost-*';
$metadata[] = 'xcomment-*';

return $metadata;
}
}

endif; // class_exists