From 674552513b4dca3e9c05cb1e649b73036d06f323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 2 Jan 2025 19:26:04 +0100 Subject: [PATCH] refactor function actor_is_event_source --- includes/class-event-sources.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/class-event-sources.php b/includes/class-event-sources.php index 881db58..98cb907 100644 --- a/includes/class-event-sources.php +++ b/includes/class-event-sources.php @@ -482,11 +482,9 @@ class Event_Sources { * @return bool True if the ActivityPub actor ID is followed, false otherwise. */ public static function actor_is_event_source( $actor_id ) { - $event_sources = Event_Sources_Collection::get_event_sources(); - foreach ( $event_sources as $event_source ) { - if ( $actor_id === $event_source->get_id() ) { - return true; - } + $event_sources_ids = self::get_event_sources_ids(); + if ( in_array( $actor_id, $event_sources_ids, true ) ) { + return true; } return false; }