diff --git a/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js b/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js index 796f3673bd..f5efcd01b4 100644 --- a/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js +++ b/assets/admin/course-pre-publish-panel/course-pre-publish-panel.js @@ -4,7 +4,7 @@ import { __ } from '@wordpress/i18n'; import { useEntityProp } from '@wordpress/core-data'; import { PluginPrePublishPanel as DeprecatedPluginPrePublishPanel } from '@wordpress/edit-post'; -import { PluginPrePublishPanel } from '@wordpress/editor'; +import { PluginPrePublishPanel as NewPluginPrePublishPanel } from '@wordpress/editor'; import { ToggleControl } from '@wordpress/components'; /** @@ -12,9 +12,8 @@ import { ToggleControl } from '@wordpress/components'; */ import SenseiIcon from '../../icons/logo-tree.svg'; -if ( ! PluginPrePublishPanel ) { - PluginPrePublishPanel = DeprecatedPluginPrePublishPanel; -} +const PluginPrePublishPanel = + NewPluginPrePublishPanel || DeprecatedPluginPrePublishPanel; /** * Course pre-publish panel. diff --git a/assets/blocks/quiz/question-block/single-question.js b/assets/blocks/quiz/question-block/single-question.js index d39c0fb4f2..4cdc155157 100644 --- a/assets/blocks/quiz/question-block/single-question.js +++ b/assets/blocks/quiz/question-block/single-question.js @@ -8,20 +8,20 @@ import { PluginPostStatusInfo as DeprecatedPluginPostStatusInfo, PluginPrePublishPanel as DeprecatedPluginPrePublishPanel, } from '@wordpress/edit-post'; -import { PluginPostStatusInfo, PluginPrePublishPanel } from '@wordpress/editor'; +import { + PluginPostStatusInfo as NewPluginPostStatusInfo, + PluginPrePublishPanel as NewPluginPrePublishPanel, +} from '@wordpress/editor'; /** * Internal dependencies */ import { Effect, usePostSavingEffect } from '../../../shared/helpers/blocks'; -if ( ! PluginPostStatusInfo ) { - PluginPostStatusInfo = DeprecatedPluginPostStatusInfo; -} - -if ( ! PluginPrePublishPanel ) { - PluginPrePublishPanel = DeprecatedPluginPrePublishPanel; -} +const PluginPostStatusInfo = + NewPluginPostStatusInfo || DeprecatedPluginPostStatusInfo; +const PluginPrePublishPanel = + NewPluginPrePublishPanel || DeprecatedPluginPrePublishPanel; /** * Additional controls for a question block in the single question editor. diff --git a/assets/blocks/quiz/quiz-block/quiz-validation.js b/assets/blocks/quiz/quiz-block/quiz-validation.js index 1126b0c814..102e7d9d70 100644 --- a/assets/blocks/quiz/quiz-block/quiz-validation.js +++ b/assets/blocks/quiz/quiz-block/quiz-validation.js @@ -7,7 +7,10 @@ import { PluginPostStatusInfo as DeprecatedPluginPostStatusInfo, PluginPrePublishPanel as DeprecatedPluginPrePublishPanel, } from '@wordpress/edit-post'; -import { PluginPostStatusInfo, PluginPrePublishPanel } from '@wordpress/editor'; +import { + PluginPostStatusInfo as NewPluginPostStatusInfo, + PluginPrePublishPanel as NewPluginPrePublishPanel, +} from '@wordpress/editor'; import { useCallback } from '@wordpress/element'; import { __, _n, sprintf } from '@wordpress/i18n'; @@ -17,13 +20,10 @@ import { __, _n, sprintf } from '@wordpress/i18n'; import { BLOCK_META_STORE } from '../../../shared/blocks/block-metadata'; import { Effect, usePostSavingEffect } from '../../../shared/helpers/blocks'; -if ( ! PluginPostStatusInfo ) { - PluginPostStatusInfo = DeprecatedPluginPostStatusInfo; -} - -if ( ! PluginPrePublishPanel ) { - PluginPrePublishPanel = DeprecatedPluginPrePublishPanel; -} +const PluginPostStatusInfo = + NewPluginPostStatusInfo || DeprecatedPluginPostStatusInfo; +const PluginPrePublishPanel = + NewPluginPrePublishPanel || DeprecatedPluginPrePublishPanel; /** * Notice about incomplete questions in the quiz.