Skip to content

Add current post ID and type to context#154

Merged
ryanwelcher merged 4 commits intotrunkfrom
feature/add-context-to-components
Feb 23, 2026
Merged

Add current post ID and type to context#154
ryanwelcher merged 4 commits intotrunkfrom
feature/add-context-to-components

Conversation

@ryanwelcher
Copy link
Owner

Introduces new items to the context being passed to each component.

Closes #145

@ryanwelcher ryanwelcher added this to the 4.4.0 milestone Feb 23, 2026
@ryanwelcher ryanwelcher self-assigned this Feb 23, 2026
@ryanwelcher ryanwelcher requested a review from Copilot February 23, 2026 17:47
@ryanwelcher ryanwelcher changed the title Feature/add context to components Add current post ID and type to context Feb 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enriches the props/context passed into Advanced Query Loop (AQL) editor-side control components and SlotFills so extension plugins can read the currently edited entity (post/page/template) when building query vars—addressing the “context in editor” need raised in #145.

Changes:

  • Adds context.currentPostId and context.currentPostType to the props passed into AQL controls/SlotFills in the block editor.
  • Documents the newly available context values in extending-aql.md (and updates examples).
  • Updates CLAUDE.md architecture notes to reflect the enriched propsWithControls.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/variations/controls.js Uses useSelect to read current editor entity info and injects it into propsWithControls.context.
extending-aql.md Documents the enriched context passed to extension controls and updates example signatures.
CLAUDE.md Notes that propsWithControls now includes current editor entity context fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ryanwelcher and others added 2 commits February 23, 2026 12:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ryanwelcher ryanwelcher added the enhancement New feature or request label Feb 23, 2026
@ryanwelcher ryanwelcher merged commit 8c16ddf into trunk Feb 23, 2026
7 checks passed
@ryanwelcher ryanwelcher deleted the feature/add-context-to-components branch February 23, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't find a way to access context of AQL block within aql_query_vars filter

2 participants