From 2f9225f097fd0cdf1ed3dc6159fd6048d6d3d257 Mon Sep 17 00:00:00 2001 From: Jeff Ong Date: Wed, 18 Sep 2024 13:54:16 -0400 Subject: [PATCH] Add minimum version to additional metadata panel. --- src/editor-sidebar/create-panel.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/editor-sidebar/create-panel.js b/src/editor-sidebar/create-panel.js index b80aa1fb..951c03a0 100644 --- a/src/editor-sidebar/create-panel.js +++ b/src/editor-sidebar/create-panel.js @@ -14,6 +14,7 @@ import { __experimentalText as Text, PanelBody, Button, + SelectControl, TextControl, TextareaControl, } from '@wordpress/components'; @@ -28,6 +29,9 @@ import { createClonedTheme, createChildTheme, } from '../resolvers'; +import { generateWpVersions } from '../utils/generate-versions'; + +const WP_MINIMUM_VERSIONS = generateWpVersions( WP_VERSION ); // eslint-disable-line no-undef export const CreateThemePanel = ( { createType } ) => { const { createErrorNotice } = useDispatch( noticesStore ); @@ -47,6 +51,7 @@ export const CreateThemePanel = ( { createType } ) => { author: '', author_uri: '', tags_custom: '', + requires_wp: '', subfolder, } ); @@ -195,6 +200,20 @@ export const CreateThemePanel = ( { createType } ) => { 'create-block-theme' ) } /> + ( { + label: version, + value: version, + } ) ) } + onChange={ ( value ) => { + setTheme( { ...theme, requires_wp: value } ); + } } + />
{ createType === 'createClone' && (