From af5cafc91d7312e1736eebc6adcebd68aca3c4e6 Mon Sep 17 00:00:00 2001 From: Rasmy Nguyen Date: Mon, 12 Feb 2024 15:49:14 -0500 Subject: [PATCH] fix: prevent coauthor filter on rest request --- .../distributor-customizations/class-authorship-filters.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/distributor-customizations/class-authorship-filters.php b/includes/distributor-customizations/class-authorship-filters.php index e608af7b..946989d2 100644 --- a/includes/distributor-customizations/class-authorship-filters.php +++ b/includes/distributor-customizations/class-authorship-filters.php @@ -44,7 +44,7 @@ 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() ) { + if ( is_admin() || defined( 'REST_REQUEST' ) && REST_REQUEST ) { return $coauthors; }