Skip to content

feat(elementskit): add ElementsKit integration - #213

Open
RishadAlam wants to merge 7 commits into
mainfrom
feat/elementskit
Open

RishadAlam wants to merge 7 commits into
mainfrom
feat/elementskit

Conversation

@RishadAlam

Copy link
Copy Markdown
Member

Pull Request

Description

Adds the free side of the ElementsKit integration: the action backend that fires the bit_integrations_elements_kit_* hooks and logs the result, and the three-step integration UI. Ten write actions covering ElementsKit templates, Widget Builder widgets and dynamic content.

Pairs with the matching PR on bit-integrations-pro, which carries the handlers those hooks call.

Motivation & Context

ElementsKit is one of the most widely used Elementor addons, but the headers, footers and custom widgets it manages could not be created or updated from a flow. This adds it as an action app, so a form submission or any other trigger can build and maintain those pieces without anyone opening the builder.

Per the split, Free performs no writes of its own — it fires the hook and records the response in the Task Log.

Related Links: (if applicable)

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 📚 Documentation update
  • ⚡ Improvement
  • 🔄 Code refactor

Key Changes

Backend

  • Added ElementsKitController with the activation check, the dynamic content list used by the parent dropdown, and execute()
  • Added RecordApiHelper switching over the ten write actions, with a literal hook string per case and LogHandler::save on every path
  • Added Routes.php exposing refresh_elements_kit_contents
  • Added the ElementsKit entry to AllTriggersName
  • Added class_exists('ElementsKit_Lite') as the activation marker, since ElementsKit Lite defines no plugin constant

Frontend

  • Added the integration UI — authorization, field map, layout, utilities, wizard and edit screens — registered in NewInteg, EditInteg, IntegInfo and SelectAction
  • Added authorization through the shared WP_PLUGIN_CHECK step, asserting on the plugin class rather than a constant
  • Added individually mappable widget fields — Icon, Categories, Markup, CSS and JavaScript — leaving JSON for the Elementor controls alone
  • Fixed a Utility that could never be unticked once set, leaving an unwanted override on every run of the action
  • Fixed the Parent Item dropdown, which passed a boolean instead of a list before its fetch resolved, and gained a "No Parent" option so a parent can be detached rather than only swapped
  • Fixed each Utility modal printing its title twice
  • Fixed an inherited field-map bug while cloning the layout: the required-field branch compared an index against the array rather than its length, so the second select never pre-filled

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated if needed
  • README updated if needed

Changelog

  • New Integration: ElementsKit — create and manage Elementor headers, footers, custom widgets and dynamic content from any flow
  • New Actions: ElementsKit — 10 actions covering create, update and delete for templates, widgets and dynamic content, plus header/footer activation

Free side of the ElementsKit action integration. It performs no writes of its
own — each action fires bit_integrations_elements_kit_* and lets the Pro
handler do the work, then logs whatever comes back.

RecordApiHelper switches over the eleven write actions with a literal hook
string per case, and passes only the arguments each Pro handler reads: the
field map alone for update_setting, plus utilities and/or the integration
config for the rest.

Also adds the refresh_elements_kit_contents route, which lists dynamic content
items for the optional parent dropdown. That is a read, so it stays in Free.

ElementsKit Lite defines no plugin constant, so class_exists('ElementsKit_Lite')
is the activation check throughout.
Three-step wizard plus the edit screen, cloned from the FluentCart layout, and
registered in NewInteg, EditInteg, IntegInfo and SelectAction.

Authorization goes through the shared WP_PLUGIN_CHECK step. ElementsKit Lite
ships no plugin constant, so the check asserts on its main class instead, which
PluginCheck already supports as a `class` type.

Inputs are split the way the field-map rule asks for. The id of the record an
action targets — template, widget, content, setting key — stays in the field
map so it can be mapped from trigger data. Fixed option sets are selects:
template type and activation render in the layout where the action requires
them, and status, type, display conditions and delete mode sit behind
Utilities. The optional parent item is the one fetched dropdown.

The FieldMap component drops an inherited bug while cloning: the required-field
branch compared an index against the array rather than its length, and then
read .label where the option value belongs, so the second select never
pre-filled. It now compares against .length and uses .key.
Four problems in the ElementsKit action screen.

A ticked Utility could never be unticked. The checkbox always reopened the
picker, so once a Status or Delete Mode override was set there was no way to
remove it and the action carried that value on every run. Ticking now opens the
picker and unticking clears the value.

The Parent Item dropdown passed a boolean rather than an array while the fetch
was still in flight, because the guard chain collapsed to false instead of an
empty list.

There was also no way to detach a parent once one had been chosen, only to swap
it for another. A No Parent option covers that; the Pro handler tells an
explicit choice apart from an untouched dropdown.

Each Utility modal printed its title twice, since ConfirmModal already renders
the title as its header and the body repeated the same string. The header now
carries the short name and the body explains what the option does.
Removes the action from the module list, the field-map definition it used and
the hook case that fired it. Ten actions remain, covering templates, widgets
and dynamic content.
… blob

Icon, Categories, Markup, CSS and JavaScript become field-map rows on Create
Widget and Update Widget, so their values can come from the form submission
rather than being embedded in a hand-written JSON string. Categories accepts a
comma separated list.

Widget Controls keeps taking JSON, because the Elementor controls nest sections
inside tabs and controls inside sections and cannot be flattened into a field
map. The Pro handler treats it as the base layer and lays the mapped fields over
it.
Removes the two file header blocks that only repeated the namespace and a block
label above the option-set constants.

The translators note above the wp_sprintf call stays, since phpcs requires it,
along with the comments explaining why the plugin class stands in for a missing
constant, why the parent list refetches on edit, and why unticking a utility
clears it.
Copilot AI lite review requested due to automatic review settings August 22, 2026 05:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 22, 2026 05:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Removes both actions from the module list, the field-map definitions they
used, their entries in the status-utility and utilities lists, the switch
cases in the integration layout, the Widget Controls JSON note, and the two
Hooks::apply dispatch cases in RecordApiHelper.

Get Widget, Delete Widget and the widget triggers are unaffected.
Copilot AI review requested due to automatic review settings September 2, 2026 05:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants