Claude Skill

wp-editor-components

Build or migrate WordPress editor and plugin React interfaces using public @wordpress/components APIs. Covers dependency handles, accessible controlled controls, WordPress 7.1 40px form-control defaults, removed Navigation and __experimentalApplyValueToSides APIs, Navigator migra

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download lonsdale201-wp-agent-skills-wordpress_wp-editor-components-52f6020.zip · 4 KB
Part of lonsdale201/wp-agent-skills — 226 skills

Install

skills CLI npx skills add https://github.com/Lonsdale201/wp-agent-skills/tree/main/wordpress/wp-editor-components
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install lonsdale201-wp-agent-skills@llmmart
Git git clone https://github.com/Lonsdale201/wp-agent-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole lonsdale201/wp-agent-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

WordPress Editor Components

Use public WordPress components for editor/admin application UI, but keep form state, persistence, authorization, and errors in your own explicit data flow. Component visibility and disabled state are never server-side access control.

Load the package correctly

When using @wordpress/scripts, import packages normally and consume the generated .asset.php file so wp-components, wp-element, wp-i18n, and other dependencies are declared automatically. Do not bundle a second React or reach through window.wp.components private properties to bypass the build.

Load component CSS in the target document. WordPress 7.1's post-editor canvas is always iframed, so distinguish shell components from block content styles. If custom UI uses @wordpress/theme or --wpds-* tokens, declare the matching wp-theme script/style dependency; the two registries are independent.

Build accessible controlled controls

import { TextControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

<TextControl
	label={ __( 'API label', 'acme' ) }
	value={ label }
	onChange={ setLabel }
	help={ error || __( 'Shown to editors.', 'acme' ) }
/>;

Keep a stable controlled value and provide real labels, help/error association, keyboard behavior, focus restoration, and loading feedback. Do not scrape a component's generated DOM, class names, or Emotion identifiers. Use documented props and composition.

WordPress 7.1 form-control sizing

Affected form controls now use a 40px default unconditionally. Remove __next40pxDefaultSize; it has no runtime effect, and false does not restore 36px. On BorderBoxControl, BorderControl, FontSizePicker, and ToggleGroupControl, the old size prop is also deprecated and ineffective.

This rollout does not include Button; do not mechanically remove a Button opt-in without checking its current contract. Audit surrounding fixed heights, grid rows, modal footers, and custom CSS instead of forcing old internal dimensions back onto the component.

Removed and changed APIs

  • Navigation and its subcomponents were removed in 7.1. Migrate navigation state and screens to Navigator; it is not a one-name import replacement.
  • __experimentalApplyValueToSides was removed. Keep BoxControl, but move side-value transformation into plugin-owned data logic.
  • View still accepts css for type compatibility, but the prop is a no-op. Use style or className.
  • Divider, Surface, Truncate, View, Flex, and Spacer are among the components moving away from Emotion implementation details. If using Emotion cx()/css(), compose order-dependent fragments in one css() call before cx(); preferably use scoped classes.

Read references/wp-71-migration-matrix.md for the affected controls and before/after checks.

Design-system boundary

Prefer a WordPress component over styling low-level tokens directly. For a plugin-owned themed application subtree, public ThemeProvider can set primary and background seed colors, cursor behavior, and corner radius. Render at most one isRoot provider per document, accept only valid opaque colors, and verify actual contrast; the generated palette cannot guarantee every combination.

Do not globally restyle core editor controls from plugin CSS. Scope any plugin-specific surface and test it with admin color schemes, RTL, high contrast, zoom, and narrow viewports.

Migration workflow

  1. Search imports/JSX for removed, deprecated, __experimental, __unstable, css, generated-class, and fixed-height dependencies.
  2. Confirm the installed WordPress package version and public documentation.
  3. Migrate one behavior at a time; do not silence console warnings with aliases.
  4. Rebuild dependency metadata and verify the script/style handles.
  5. Test keyboard, focus, screen reader naming, errors, loading, RTL, zoom, and both Post/Site Editor contexts.
  6. Test the oldest supported WordPress or feature-detect an optional export.

Security and performance

  • Re-check permissions and sanitize writes at REST/Ajax handlers.
  • Never render untrusted HTML through component escape hatches.
  • Debounce deliberate search, cancel stale requests, and avoid a request on every uncontrolled render.
  • Keep selectors stable and subscriptions narrow; memoize only after measuring.
  • Treat experimental APIs as unstable even when they happen to exist in Core.
  • React 19 did not ship in WordPress 7.1; do not code against that experiment as the Core runtime contract.

Related skills

  • wp-dataviews-dataform for dataset and form abstractions.
  • wp-block-editor-iframe-compatibility for canvas/shell document boundaries.
  • wp-plugin-assets-loading for handles, generated metadata, and wp-theme.

References

Files (wp-agent-skills)
  • agents
    • openai.yaml 252 B
      interface:
        display_name: "WordPress editor components"
        short_description: "Migrate accessible editor UI to WordPress 7.1"
        default_prompt: "Use $wp-editor-components to build or migrate this WordPress editor interface with public component APIs."
      
  • references
    • wp-71-migration-matrix.md 2 KB
      # WordPress 7.1 editor component migration matrix
      
      ## 40px form-control rollout
      
      Remove `__next40pxDefaultSize` from these affected component groups and test
      their surrounding layouts:
      
      - `@wordpress/components`: `BorderBoxControl`, `BorderControl`, `BoxControl`,
        `ComboboxControl`, `CustomSelectControl`, `FontSizePicker`, `FormFileUpload`,
        `FormTokenField`, `FocalPointPicker`, `InputControl`, `NumberControl`,
        `QueryControls`, `Radio`, `RangeControl`, `SearchControl`, `SelectControl`,
        `TextControl`, `ToggleGroupControl`, `TreeSelect`, and `UnitControl`.
      - `@wordpress/block-editor`: `FontAppearanceControl`, `FontFamilyControl`,
        `LetterSpacingControl`, and `LineHeightControl`.
      
      The rollout is for form controls, not `Button`. On `BorderBoxControl`,
      `BorderControl`, `FontSizePicker`, and `ToggleGroupControl`, remove a `size`
      prop that was used to manipulate the old control height.
      
      ## API changes
      
      | Before | WordPress 7.1 action |
      |---|---|
      | `Navigation` / subcomponents | Redesign with `Navigator` |
      | `__experimentalApplyValueToSides` | Plugin-owned side-value logic |
      | `<View css={...}>` | `style` or scoped `className` |
      | Separate Emotion fragments passed to `cx()` | Compose order-sensitive fragments in one `css()` call |
      
      ## Review probes
      
      - No console warning or failed import on the production Core build.
      - Controls remain aligned without hard-coded 36px assumptions.
      - Focus order and focus return remain correct in `Navigator` screens.
      - CSS still wins by intentional specificity/source order, not generated class
        names.
      - The bundle externalizes WordPress packages and has accurate `.asset.php`
        dependencies.
      - Shell UI works with the always-iframed editor and persistent admin toolbar.
      
      ## Primary sources
      
      - <https://make.wordpress.org/core/2026/07/23/editor-components-updates-in-wordpress-7-1/>
      - <https://make.wordpress.org/core/2026/07/31/design-system-theming-in-wordpress-7-1/>
      - <https://make.wordpress.org/core/2026/08/04/miscellaneous-block-editor-changes-in-wordpress-7-1/>
      
      
  • SKILL.md 6.2 KB
    ---
    name: wp-editor-components
    description: >-
      Build or migrate WordPress editor and plugin React interfaces using public
      @wordpress/components APIs. Covers dependency handles, accessible controlled
      controls, WordPress 7.1 40px form-control defaults, removed Navigation and
      __experimentalApplyValueToSides APIs, Navigator migration, Emotion-to-SCSS
      styling changes, View's no-op css prop, and design-system integration. Use
      when plugin JavaScript imports @wordpress/components, renders Inspector or
      admin controls, has 7.1 layout regressions, console deprecations, or relies on
      private/generated component markup and classes.
    license: GPLv2-or-later
    metadata:
      wp-skills-author: "Soczó Kristóf"
      wp-skills-contact: "mailto:lonsdale201@hotmail.com"
      wp-skills-plugin: "wordpress"
      wp-skills-plugin-version-tested: "7.1"
      wp-skills-wp-version-tested: "7.1"
      wp-skills-php-min: "7.4"
      wp-skills-last-updated: "2026-08-20"
    ---
    
    # WordPress Editor Components
    
    Use public WordPress components for editor/admin application UI, but keep form
    state, persistence, authorization, and errors in your own explicit data flow.
    Component visibility and disabled state are never server-side access control.
    
    ## Load the package correctly
    
    When using `@wordpress/scripts`, import packages normally and consume the
    generated `.asset.php` file so `wp-components`, `wp-element`, `wp-i18n`, and
    other dependencies are declared automatically. Do not bundle a second React or
    reach through `window.wp.components` private properties to bypass the build.
    
    Load component CSS in the target document. WordPress 7.1's post-editor canvas
    is always iframed, so distinguish shell components from block content styles.
    If custom UI uses `@wordpress/theme` or `--wpds-*` tokens, declare the matching
    `wp-theme` script/style dependency; the two registries are independent.
    
    ## Build accessible controlled controls
    
    ```jsx
    import { TextControl } from '@wordpress/components';
    import { __ } from '@wordpress/i18n';
    
    <TextControl
    	label={ __( 'API label', 'acme' ) }
    	value={ label }
    	onChange={ setLabel }
    	help={ error || __( 'Shown to editors.', 'acme' ) }
    />;
    ```
    
    Keep a stable controlled value and provide real labels, help/error association,
    keyboard behavior, focus restoration, and loading feedback. Do not scrape a
    component's generated DOM, class names, or Emotion identifiers. Use documented
    props and composition.
    
    ## WordPress 7.1 form-control sizing
    
    Affected form controls now use a 40px default unconditionally. Remove
    `__next40pxDefaultSize`; it has no runtime effect, and `false` does not restore
    36px. On `BorderBoxControl`, `BorderControl`, `FontSizePicker`, and
    `ToggleGroupControl`, the old `size` prop is also deprecated and ineffective.
    
    This rollout does not include `Button`; do not mechanically remove a Button
    opt-in without checking its current contract. Audit surrounding fixed heights,
    grid rows, modal footers, and custom CSS instead of forcing old internal
    dimensions back onto the component.
    
    ## Removed and changed APIs
    
    - `Navigation` and its subcomponents were removed in 7.1. Migrate navigation
      state and screens to `Navigator`; it is not a one-name import replacement.
    - `__experimentalApplyValueToSides` was removed. Keep `BoxControl`, but move
      side-value transformation into plugin-owned data logic.
    - `View` still accepts `css` for type compatibility, but the prop is a no-op.
      Use `style` or `className`.
    - `Divider`, `Surface`, `Truncate`, `View`, `Flex`, and `Spacer` are among the
      components moving away from Emotion implementation details. If using
      Emotion `cx()`/`css()`, compose order-dependent fragments in one `css()` call
      before `cx()`; preferably use scoped classes.
    
    Read `references/wp-71-migration-matrix.md` for the affected controls and
    before/after checks.
    
    ## Design-system boundary
    
    Prefer a WordPress component over styling low-level tokens directly. For a
    plugin-owned themed application subtree, public `ThemeProvider` can set primary
    and background seed colors, cursor behavior, and corner radius. Render at most
    one `isRoot` provider per document, accept only valid opaque colors, and verify
    actual contrast; the generated palette cannot guarantee every combination.
    
    Do not globally restyle core editor controls from plugin CSS. Scope any
    plugin-specific surface and test it with admin color schemes, RTL, high
    contrast, zoom, and narrow viewports.
    
    ## Migration workflow
    
    1. Search imports/JSX for removed, deprecated, `__experimental`, `__unstable`,
       `css`, generated-class, and fixed-height dependencies.
    2. Confirm the installed WordPress package version and public documentation.
    3. Migrate one behavior at a time; do not silence console warnings with aliases.
    4. Rebuild dependency metadata and verify the script/style handles.
    5. Test keyboard, focus, screen reader naming, errors, loading, RTL, zoom, and
       both Post/Site Editor contexts.
    6. Test the oldest supported WordPress or feature-detect an optional export.
    
    ## Security and performance
    
    - Re-check permissions and sanitize writes at REST/Ajax handlers.
    - Never render untrusted HTML through component escape hatches.
    - Debounce deliberate search, cancel stale requests, and avoid a request on
      every uncontrolled render.
    - Keep selectors stable and subscriptions narrow; memoize only after measuring.
    - Treat experimental APIs as unstable even when they happen to exist in Core.
    - React 19 did not ship in WordPress 7.1; do not code against that experiment as
      the Core runtime contract.
    
    ## Related skills
    
    - `wp-dataviews-dataform` for dataset and form abstractions.
    - `wp-block-editor-iframe-compatibility` for canvas/shell document boundaries.
    - `wp-plugin-assets-loading` for handles, generated metadata, and `wp-theme`.
    
    ## References
    
    - Read `references/wp-71-migration-matrix.md` for the per-component removal/replacement matrix.
    - Editor components updates in WordPress 7.1: <https://make.wordpress.org/core/2026/07/23/editor-components-updates-in-wordpress-7-1/>
    - Design system theming in WordPress 7.1: <https://make.wordpress.org/core/2026/07/31/design-system-theming-in-wordpress-7-1/>
    - Miscellaneous block editor changes in WordPress 7.1: <https://make.wordpress.org/core/2026/08/04/miscellaneous-block-editor-changes-in-wordpress-7-1/>
    - WordPress 7.1 Field Guide: <https://make.wordpress.org/core/2026/08/05/wordpress-7-1-field-guide/>
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related