Guide

Related Posts architecture

Main plugin: includes/class-plugin.php. Resolution API: includes/class-api.php. Editor panel under includes/inspector-sidebar-panel/. Block: src/related-posts-query/.

Resolution

Manual relatedPosts post meta wins. Otherwise API builds candidates from taxonomy (primary term first), shapes rows with title, permalink, date, format label, and caches the result.

Child posts resolve related content against their parent ID.

Meta schema

relatedPosts items: date, key, link, permalink, postId, title, label.

Caching

  • Object cache key family relatedPosts, default TTL 1 hour
  • VIP purge hooks on content update
  • Cache bypassed for logged-in users and preview contexts

Filters and support

HookPurpose
prc_platform__related_posts_enabled_post_typesExtend beyond default post
prc_platform_on_updateCache clear

AI experiment

includes/ai-experiment/ registers Ability prc-related-posts/suggest (Parse.ly recommendations when configured, else category candidates + AI rank). See Abilities.

Was this helpful?