--- name: wordpress-elementor-dev description: > Expert WordPress and Elementor Pro development skill. Use this whenever the user asks about WordPress theme development, Elementor Pro customization, plugin architecture, custom post types, hooks/filters, Loop Grids, Dynamic Tags, Theme Builder templates, off-canvas UIs, custom CSS/JS injection, performance optimization, or any PHP/JS/CSS code targeting a WordPress or Elementor environment. Trigger even for general questions like "how do I add a custom field in Elementor", "what hook should I use for X in WordPress", "how do I override a WooCommerce template", or "how do I register a custom widget" — do not wait for the user to explicitly say "use the skill." Also trigger for ACF integration, REST API endpoints, child theme setup, WooCommerce customization, WPML/multilingual setups, and any debugging of WordPress/Elementor issues. --- # WordPress & Elementor Pro — Skill Router A complete procedural guide for producing production-grade WordPress and Elementor Pro code. This file is the **router** — read it first, then load the relevant sub-file(s) for the task at hand. --- ## Sub-file Map — Read the Right File for Each Task | Task type | Read this file | |---|---| | Plugin scaffold, child theme, code placement, CPT, AJAX handler | **scaffolding.md** | | PHP standards, sanitization, escaping, nonces, WP_Error, transients, password hashing | **php-standards.md** | | JavaScript standards, enqueue API, defer/async, wp_add_inline_script | **js-css-standards.md** | | CSS standards, BEM, design tokens, Elementor CSS selectors | **js-css-standards.md** | | Elementor custom widget, Dynamic Tags, Loop Grid, Form actions, Theme Builder conditions | **elementor-patterns.md** | | Elementor extension points — custom **form fields**, **theme locations**, injecting controls into native widgets, **adding a TAB to the editor's Elements panel**, Finder/context-menu, hooks reference, deprecations | **elementor-extending.md** | | WooCommerce HPOS, order API, template overrides, Loop Grid for products | **woocommerce.md** | | REST API endpoints, schema, permission callbacks | **rest-api.md** | | Off-canvas UI, off-canvas accessibility, focus trap | **offcanvas-ui.md** | | Performance checklists (frontend + backend), speculative loading, IE conditional comments | **performance.md** | | Accessibility checklist, WCAG 2.2 AA, ARIA patterns | **performance.md** | | **Hard-won production gotchas** — widget lifecycle fatals, `content_template()` escaping, CSS-in-Elementor footguns, transactional email, wp.org review/packaging, embedding apps, AJAX/loop re-rendering, dynamic CSS in loops, Swiper on optimised sites, holding a login without counting it as failed | **field-notes.md** | | **wordpress.org submission** — the 18 Directory Guidelines, Plugin Check 2.1.0 categories/usage, review process, required headers/readme | **wp-org-guidelines.md** | | **Subversion (SVN)** — deploying/tagging a release on the wordpress.org plugin/theme SVN (trunk/tags/assets), the daily work cycle, branching/merging, properties, repo admin | **svn/svn.md** (self-contained sub-bundle; `svn/references/` goes deeper) | | **Debugging & static analysis** — PHPCS+WPCS, PHPStan, Plugin Check, `WP_DEBUG`/Query Monitor, Elementor Safe Mode/cache, symptom→cause table | **debugging.md** | | **Common WordPress APIs** — admin settings page (Settings + Options API), `register_meta`, roles/capabilities, WP-Cron, internationalization (i18n) | **wordpress-apis.md** | | **Database layer (MariaDB/MySQL)** — custom tables + `dbDelta()`, charsets & the `varchar(191)` index rule, indexes, `EXPLAIN`, MariaDB↔MySQL portability, `sql_mode`, full-text | **mariadb.md** | ### Widget Boilerplates — Load when building a widget of that type | Widget type | Read this file | |---|---| | Button / CTA with icon and link | **widget-button.md** | | Container / layout wrapper / section / card shell | **widget-container.md** | | Image with caption, link, lightbox | **widget-image.md** | | Heading / title / HTML tag selector | **widget-heading.md** | | Rich text / WYSIWYG body content | **widget-text-editor.md** | | Video embed (YouTube, Vimeo, self-hosted) | **widget-video.md** | | Widget that renders a saved Elementor template by ID | **widget-elementor-template.md** (SELECT2, `get_builder_content_for_display()`, Dynamic Tags context, CSS timing) | | Widget whose markup lives in a separate PHP template file | **widget-php-template.md** (Strategies A/B/C, `load_template()`, `ob_start`, path-traversal safety) | | Divider / horizontal rule with optional text or icon | **widget-divider.md** | | Spacer / vertical gap | **widget-spacer.md** | | Single standalone icon with optional link | **widget-icon.md** | | Icon + title + description box | **widget-icon-box.md** | | Image + title + description box | **widget-image-box.md** | | Image grid / gallery | **widget-image-gallery.md** | | Image slider / carousel | **widget-image-carousel.md** | | Bullet list with icons per item | **widget-icon-list.md** | | Animated number counter | **widget-counter.md** | | Percentage progress bar | **widget-progress.md** | | Customer quote / testimonial | **widget-testimonial.md** | | Tabbed content panels | **widget-tabs.md** | | Accordion — one panel open at a time | **widget-accordion.md** | | Toggle — multiple panels open simultaneously | **widget-toggle.md** | | Social media icon links row | **widget-social-icons.md** | | Colored alert / notice box | **widget-alert.md** | | Audio player (SoundCloud / self-hosted) | **widget-audio.md** | | WordPress shortcode output | **widget-shortcode.md** | | Raw custom HTML / JS / CSS embed | **widget-html.md** | | Named anchor for in-page navigation | **widget-menu-anchor.md** | | WordPress registered sidebar output | **widget-sidebar.md** | | WordPress read more tag | **widget-read-more.md** | | Google Maps embed | **widget-google-maps.md** | | Decorative star rating display | **widget-star-rating.md** | | Schema-ready structured rating | **widget-rating.md** | | Text following a curved / custom SVG path | **widget-text-path.md** | | Nested Tabs / Nested Accordion (each panel is a Container holding any widgets) | **widget-nested.md** | **Always read the relevant sub-file before writing code.** For tasks that span multiple areas (e.g. a WooCommerce widget with custom REST endpoint), read all relevant sub-files. For a widget task, read BOTH the widget boilerplate file AND **elementor-patterns.md**. For **any custom widget, plugin, or wp.org-bound work, also skim `field-notes.md`** — it catches the lint-passing, review-failing, site-down mistakes the topic files don't dwell on. --- ## 0. Golden Rules (Never Violate) These override everything in all sub-files: 1. **Native APIs first** — WordPress core hook before plugin; Elementor API before template override. 2. **Sanitize in, escape out** — Every input sanitized. Every output escaped. No exceptions. 3. **Prefix everything** — All functions, classes, constants, hooks, and CSS classes use a project-specific prefix. 4. **State your placement** — Every code response must declare exactly where the code lives. 5. **No over-clarifying** — Only ask a clarification question if the missing info would materially change the code output. Otherwise, state your assumption and proceed. 6. **NEVER hardcode visual settings in widgets** — Every visual property (colors, fonts, sizes, spacing, backgrounds, borders, shadows, alignment) MUST be exposed as a standard Elementor control in the editor panel. Users control appearance via the toolbar — not by editing code. See §5 "Mandatory Widget Controls" below for the required controls checklist. 7. **Name for the directory from day one** — Naming is decided first and is effectively irreversible, so get it right before writing code. The plugin **slug/name must NOT start with a trademark you don't own** — `"CRM for WooCommerce"`, never `"WooCommerce CRM"` (Directory Guideline 17). The **text domain must exactly equal the plugin slug**. The wp.org slug is **permanent**, and a widget's `get_name()` is **sticky** (stored in every page's `_elementor_data` — renaming it breaks placed widgets). Choose the public name, slug, text domain, and code prefix (Rule #3) **together, once**. This is distinct from Rule #3: that governs internal code symbols; this governs the public identity. See **wp-org-guidelines.md** (Guidelines 12/16/17) and **field-notes.md** §1 (sticky `get_name()`). --- ## 1. Default Assumptions Quickly assess — **only ask if the answer would change the code**: | Info needed | Ask only if... | |---|---| | Scope (plugin vs snippet vs child theme) | Context doesn't make it obvious | | Elementor tier (Free / Pro / custom widget) | Pro-only APIs are involved | | PHP version | Code uses PHP 8.3+ features like typed class constants, or 8.4+ features like property hooks | | WooCommerce / ACF / WPML present | Integration with those systems is required | **Default stack when not stated** (full release-by-release history lives in **CHANGELOG.md** — keep volatile version-tracking out of this router): | Component | Version | Notes | |---|---|---| | **WordPress** | **7.1** | **"Mary Lou", released Aug 19, 2026** (7.0 "Armstrong" was May 20; the 7.0 branch ended at 7.0.4, Aug 12). Minimum PHP **7.4** (7.2/7.3 dropped — sites still on them stay pinned to 6.9.x). No multisite assumed. **7.1 makes the post editor iframe unconditional — see below.** | | **PHP** | **8.3** recommended | 7.4 = minimum. 8.4 / 8.5 = "beta support" (possible deprecation notices). 8.2 fully compatible but no longer the recommended default. | | **Elementor (free + Pro)** | **4.2+** | Separate plugins with **independent version numbers** — currently **free 4.2.3 / Pro 4.2.2** (both Aug 19, 2026). 4.0.0 (Mar 30, 2026) made the Atomic Editor stable + default for new installs; 4.2.0 (Jul 20) added Atomic Grid (free) and Atomic Loop (Pro). ⚠️ Elementor's header still reads **"Tested up to: 7.0.4"** — it has **not** declared WP 7.1 support. **V3 `Widget_Base` remains fully supported — all skill code targets V3 and is production-safe.** | | **WooCommerce** | **11.0+** | **11.0 (Aug 4, 2026) REMOVED the product editor beta** and bumped to **Action Scheduler 4.0.0** (breaking dedup change). HPOS default-on since 8.2; 10.7 disabled HPOS "sync on read"; 10.9 defers Store API draft-order creation — see woocommerce.md. | **Note:** Elementor core and Elementor Pro have independent version numbers — always check **both** when diagnosing compatibility issues. ### WordPress 7.1 — what changed for plugin / Elementor devs WP 7.1 **"Mary Lou"** shipped **August 19, 2026** (WordCamp US). Unlike 7.0, this release contains **four changes that can break a shipped plugin** — they are listed first. No PHP or WordPress minimum changed. **🔴 Breaking — audit your plugin for these:** 1. **The post editor is now ALWAYS in an iframe** — including on sites registering legacy meta boxes, which was the last remaining escape hatch. Editor JavaScript that reaches for the global `document` / `window` now targets the **wrong document**. Use the canvas element's **`ownerDocument`** and **`defaultView`** instead: ```js // ❌ breaks in 7.1 — this is the OUTER document, not the editor canvas document.querySelector( '.my-block' ).classList.add( 'ready' ); // ✅ resolve the document from a node you already own inside the canvas const doc = myCanvasNode.ownerDocument; const view = doc.defaultView; // the iframe's `window` doc.querySelector( '.my-block' )?.classList.add( 'ready' ); view.requestAnimationFrame( … ); ``` Injected `