diff --git a/edit-post/components/header/mode-switcher/index.js b/edit-post/components/header/mode-switcher/index.js index 9b1e9198821f6..043ad2ded0841 100644 --- a/edit-post/components/header/mode-switcher/index.js +++ b/edit-post/components/header/mode-switcher/index.js @@ -4,6 +4,7 @@ import { __ } from '@wordpress/i18n'; import { MenuItemsChoice, MenuGroup } from '@wordpress/components'; import { compose } from '@wordpress/compose'; +import { applyFilters } from '@wordpress/hooks'; import { withSelect, withDispatch } from '@wordpress/data'; /** @@ -15,7 +16,7 @@ import shortcuts from '../../../keyboard-shortcuts'; * * @type {Array} */ -const MODES = [ +const MODES = applyFilters( 'editor.modeSwitcher', [ { value: 'visual', label: __( 'Visual Editor' ), @@ -24,7 +25,7 @@ const MODES = [ value: 'text', label: __( 'Code Editor' ), }, -]; +] ); function ModeSwitcher( { onSwitch, mode } ) { const choices = MODES.map( ( choice ) => {