Skip to content

Abilities API: Abstract Block Helpers #1099

Open
n7studios wants to merge 3 commits into
abilities-apifrom
abilities-api-restructure
Open

Abilities API: Abstract Block Helpers #1099
n7studios wants to merge 3 commits into
abilities-apifrom
abilities-api-restructure

Conversation

@n7studios
Copy link
Copy Markdown
Contributor

Summary

Abstracts the existing block helpers (ConvertKit_MCP_Ability_Block_List, ConvertKit_MCP_Ability_Block_Insert etc) to more generic content helpers (ConvertKit_MCP_Ability_Content_List, ConvertKit_MCP_Ability_Content_Insert etc), which use a new ConvertKit_Content_Post_Helper.

This helper detects whether the page/post being updated needs to use a Kit element (Form, Form Trigger, Broadcasts, Product) block, shortcode or third party element (such as an Elementor widget), depending on how the page/post was created in the first place.

Testing

Existing tests pass.

Checklist

@n7studios n7studios added this to the 3.4.0 milestone May 25, 2026
@n7studios n7studios self-assigned this May 25, 2026
@github-actions
Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team May 27, 2026 03:36
@n7studios n7studios marked this pull request as ready for review May 27, 2026 03:36
Copy link
Copy Markdown

@ciccio-kit ciccio-kit left a comment

Choose a reason for hiding this comment

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

LGTM ✅

return $occurrences;
}

// Normalise a "no occurrences" result (false) to an empty array.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit (non-blocking): consider moving this normalisation into ConvertKit_Content_Post_Helper::find() itself, so its return narrows from WP_Error|bool|array to WP_Error|array. Any future caller would otherwise need to repeat this check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants