$source @return array{raw:string, type:string}|null */ public function __invoke(array $source): ?array { $site = get_current_blog_id(); if ((int) $source['site_id'] !== $site) { return null; // never read another site's content } if ($source['origin'] === 'post') { $post = get_post((int) $source['origin_ref']); if (!$post instanceof \WP_Post || !KnowledgeModule::isPublic($post)) { return null; } return ['raw' => strip_shortcodes((string) $post->post_content), 'type' => 'html']; } $blob = $this->plugin->sources()->blob($site, (int) $source['id']); return $blob === null ? null : ['raw' => $blob['content'], 'type' => $blob['type']]; } }