diff --git a/CLAUDE.md b/CLAUDE.md index cf8806f..c9a97c1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Overview -HM Query Loop is a WordPress plugin that extends the core Query Loop block with advanced controls for managing multiple query loops on a single page. It provides three main features: posts per page override for inherited queries, hide on paginated pages, and exclude already displayed posts. +HM Query Loop is a WordPress plugin that extends the core Query Loop block with advanced controls for managing multiple query loops on a single page. Core features: posts per page override for inherited queries, hide on paginated pages, exclude already displayed posts, multiple post templates per query loop, query ID deduplication, and query presets. ## Development Commands @@ -30,8 +30,9 @@ HM Query Loop is a WordPress plugin that extends the core Query Loop block with The plugin uses WordPress block filters to extend the `core/query` block without creating a custom block variant. This allows it to work with any Query Loop block while preserving core functionality. ### Context System -The plugin exposes a `hm-query-loop/settings` context object from `core/query` to `core/post-template`: +The plugin exposes an `hmQueryLoop` context object from `core/query` to `core/post-template`: ```js +// context key: 'hmQueryLoop' { perPage: number | undefined, // Custom posts per page value hideOnPaged: boolean, // Whether to hide on paginated pages @@ -60,7 +61,18 @@ The plugin handles two different query scenarios: - Subsequent query loops with `excludeDisplayed` enabled filter out tracked IDs via `post__not_in` ### Editor Preview Synchronization -In src/index.js, a `useEffect` hook syncs the `hmQueryLoop.perPage` attribute to `query.perPage` to reflect the override in the editor preview. The `withPostTemplateStyles` filter adds inline CSS to hide excess posts in the editor beyond the `perPage` limit. +`withPostTemplateStyles` HOC injects an inline `