diff --git a/inc/xposts.php b/inc/xposts.php index e17aa84..e576511 100644 --- a/inc/xposts.php +++ b/inc/xposts.php @@ -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' ); } @@ -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