color-controls-migrate
Migrate blocks from PanelColorSettings to ColorGradientSettingsDropdown
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Migrate blocks from PanelColorSettings to ColorGradientSettingsDropdown
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Create a new Gutenberg block with scaffolding
Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, /wp-json/wp-abilities/v1/*, @wordpress/abilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients.
Prepare plugin for WordPress.org deployment
Use when generating responses containing factual claims, API details, configuration specifics, version compatibility, or recalled knowledge that could be hallucinated - especially when not working directly from source code or command output
Use when executing implementation plans with independent tasks in the current session
Create a block extension to enhance core WordPress blocks
| name | color-controls-migrate |
| description | Migrate blocks from PanelColorSettings to ColorGradientSettingsDropdown |
| argument-hint | ["block-name"] |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash(npm run build) |
Migrate blocks to use the modern ColorGradientSettingsDropdown component instead of deprecated PanelColorSettings.
Per CLAUDE.md:
PanelColorSettings is deprecated and will be removedColorGradientSettingsDropdown is the WordPress standardWhich block needs migration?
// ❌ REMOVE
import { PanelColorSettings } from '@wordpress/block-editor';
// ✅ ADD
import {
InspectorControls,
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
// eslint-disable-next-line @wordpress/no-unsafe-wp-apis
__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
} from '@wordpress/block-editor';
CRITICAL: Edit function MUST accept clientId
// ❌ BEFORE
export default function MyBlockEdit({ attributes, setAttributes }) {
// ✅ AFTER
export default function MyBlockEdit({ attributes, setAttributes, clientId }) {
// Add this inside your edit function
const colorGradientSettings = useMultipleOriginColorsAndGradients();
// ❌ OLD - Settings tab with PanelColorSettings
<InspectorControls>
<PanelColorSettings
title={__('Colors', 'designsetgo')}
colorSettings={[
{
value: textColor,
onChange: (color) => setAttributes({ textColor: color }),
label: __('Text Color', 'designsetgo'),
},
{
value: backgroundColor,
onChange: (color) => setAttributes({ backgroundColor: color }),
label: __('Background Color', 'designsetgo'),
},
]}
/>
</InspectorControls>
// ✅ NEW - Styles tab with ColorGradientSettingsDropdown
<InspectorControls group="color">
<ColorGradientSettingsDropdown
panelId={clientId}
title={__('Colors', 'designsetgo')}
settings={[
{
label: __('Text Color', 'designsetgo'),
colorValue: textColor,
onColorChange: (color) =>
setAttributes({ textColor: color || '' }),
clearable: true,
},
{
label: __('Background Color', 'designsetgo'),
colorValue: backgroundColor,
onColorChange: (color) =>
setAttributes({ backgroundColor: color || '' }),
clearable: true,
},
]}
{...colorGradientSettings}
/>
</InspectorControls>
| Old (PanelColorSettings) | New (ColorGradientSettingsDropdown) |
|---|---|
colorSettings array | settings array |
value property | colorValue property |
onChange callback | onColorChange callback |
| In Settings tab | In Styles tab (group="color") |
No panelId required | Requires panelId={clientId} |
| Manual theme color handling | Auto theme colors via {...colorGradientSettings} |
For colors that should only appear when a feature is enabled:
{showArrows && (
<InspectorControls group="color">
<ColorGradientSettingsDropdown
panelId={clientId}
title={__('Arrow Colors', 'designsetgo')}
settings={[
{
label: __('Arrow Color', 'designsetgo'),
colorValue: arrowColor,
onColorChange: (color) =>
setAttributes({ arrowColor: color || '' }),
clearable: true,
},
]}
{...colorGradientSettings}
/>
</InspectorControls>
)}
After migration:
Check that ALL blocks use the modern component:
# Should return 0 results
grep -r "PanelColorSettings" src/blocks/
Per CLAUDE.md:
See CLAUDE.md for the complete pattern and project status.