From 0e2c26a9ccdf69491c56c6e9a6cde0052f60b03f Mon Sep 17 00:00:00 2001 From: Douglas Johnson Date: Wed, 11 Sep 2024 13:53:33 -0400 Subject: [PATCH] Only process supported post types once per request --- php/class-coauthors-plus.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/class-coauthors-plus.php b/php/class-coauthors-plus.php index 9f40ddc2..c5007e1e 100644 --- a/php/class-coauthors-plus.php +++ b/php/class-coauthors-plus.php @@ -255,6 +255,10 @@ public function admin_init(): void { * @return array Supported post types. */ public function supported_post_types(): array { + if ( ! empty( $this->supported_post_types ) ) { + return $this->supported_post_types; + } + $post_types = array_values( get_post_types() ); $excluded_built_in = array(