-
Notifications
You must be signed in to change notification settings - Fork 0
push should set _elementor_version post meta to avoid bc-flex-widget compatibility mode #40
Description
Problem
When elementor-cli push creates or updates a page, it does not set the _elementor_version WordPress post meta key. Without this key, Elementor assumes the page was built with an older version and adds the elementor-bc-flex-widget CSS class to the page container.
This triggers a backwards-compatibility CSS rule:
.elementor:not(.elementor-bc-flex-widget) .elementor-widget-wrap { display: flex; }Because elementor-bc-flex-widget is present, the :not() selector doesn't match, and .elementor-widget-wrap falls back to display: block. This breaks any widgets using _element_width: auto (e.g., buttons intended to flow side-by-side), causing them to stack vertically instead.
How to reproduce
- Create or push a page with
elementor-cli push - Add button widgets with
_element_width: auto - Observe that buttons stack vertically instead of flowing horizontally
- Compare with a page that was saved through the Elementor editor UI — it has
_elementor_versionset and displays correctly
Workaround
Manually set the meta via WP-CLI:
wp post meta update <page-id> _elementor_version "3.32.4"Suggested fix
When elementor-cli push writes a page, it should also set _elementor_version to the installed Elementor version (or at least a recent version). This can be read from wp option get elementor_version or from the Elementor plugin metadata.
Optionally, elementor-cli pull could also include _elementor_version in page.json so it round-trips correctly.