diff --git a/assets/js/search/editor/plugins/exclude-from-search.js b/assets/js/search/editor/plugins/exclude-from-search.js index d4e7b8ef12..bf99b258ee 100644 --- a/assets/js/search/editor/plugins/exclude-from-search.js +++ b/assets/js/search/editor/plugins/exclude-from-search.js @@ -3,7 +3,8 @@ */ import { CheckboxControl } from '@wordpress/components'; import { useDispatch, useSelect } from '@wordpress/data'; -import { PluginPostStatusInfo } from '@wordpress/edit-post'; +import { PluginPostStatusInfo as PluginPostStatusInfoLegacy } from '@wordpress/edit-post'; +import { PluginPostStatusInfo } from '@wordpress/editor'; import { __ } from '@wordpress/i18n'; export default () => { @@ -17,8 +18,18 @@ export default () => { editPost({ meta: { ...meta, ep_exclude_from_search } }); }; + let WrapperElement = null; + let marginBottomProp = {}; + + if (typeof PluginPostStatusInfo !== 'undefined') { + WrapperElement = PluginPostStatusInfo; + marginBottomProp = { __nextHasNoMarginBottom: true }; + } else { + WrapperElement = PluginPostStatusInfoLegacy; + } + return ( - + { )} checked={ep_exclude_from_search} onChange={onChange} + {...marginBottomProp} /> - + ); };