Skip to content

Commit

Permalink
fix: check linked status via post meta
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenn00dle committed Feb 13, 2024
1 parent af5cafc commit e080ed8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ public static function filter_coauthors( $coauthors, $post_id ) {
}

// We don't want to filter authors on admin, as it might break things.
if ( is_admin() || defined( 'REST_REQUEST' ) && REST_REQUEST ) {
if ( is_admin() ) {
return $coauthors;
}

// Only filter posts that are still linked to the original post.
$distributor_post = new DistributorPost( $post_id );
if ( ! $distributor_post->is_linked ) {
// We check the dt_unlinked post meta to determine linked status.
// See: https://github.com/10up/distributor/blob/1f180d74db804a057f7331ce62338e571dd73350/docs/post-meta.md?plain=1#L38.
if ( get_post_meta( $post_id, 'dt_unlinked', true ) ) {
return $coauthors;
}

Expand Down

0 comments on commit e080ed8

Please sign in to comment.