*/ public static function get_cached_remote_events( $ends_before_time ): array { add_filter( 'tribe_repository_events_apply_modifier_schema_entry', array( self::class, 'add_is_activitypub_remote_cached_to_query' ), 10, 1 ); $events = tribe_events()->where( 'ends_before', $ends_before_time )->get_ids(); remove_filter( 'tribe_repository_events_apply_modifier_schema_entry', array( self::class, 'add_is_activitypub_remote_cached_to_query' ) ); return $events; } /** * Only show remote cached ActivityPub events in Tribe query. * * @param array $schema_entry The current schema entry. * @return array The modified schema entry. */ public static function add_is_activitypub_remote_cached_to_query( $schema_entry ) { $schema_entry['meta_query']['is-remote-cached'] = array( 'key' => '_event_bridge_for_activitypub_is_remote_cached', 'compare' => 'EXISTS', ); return $schema_entry; } }