: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_preferences_namespaceObject.store);
isFullscreen: get('core/edit-post', 'fullscreenMode')
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
(0,external_wp_commands_namespaceObject.useCommand)({
name: 'core/toggle-fullscreen-mode',
label: isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen'),
icon: library_fullscreen,
toggle('core/edit-post', 'fullscreenMode');
createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen off.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen on.'), {
id: 'core/edit-post/toggle-fullscreen-mode/notice',
label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
toggle('core/edit-post', 'fullscreenMode');
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/use-padding-appender.js
function usePaddingAppender() {
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
function onMouseDown(event) {
if (event.target !== node) {
const pseudoHeight = defaultView.parseInt(defaultView.getComputedStyle(node, ':after').height, 10);
// Only handle clicks under the last child.
const lastChild = node.lastElementChild;
const lastChildRect = lastChild.getBoundingClientRect();
if (event.clientY < lastChildRect.bottom) {
const blockOrder = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder('');
const lastBlockClientId = blockOrder[blockOrder.length - 1];
const lastBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(lastBlockClientId);
} = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
if (lastBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(lastBlock)) {
selectBlock(lastBlockClientId);
node.addEventListener('mousedown', onMouseDown);
node.removeEventListener('mousedown', onMouseDown);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js
const isGutenbergPlugin = false ? 0 : false;
function useShouldIframe() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_editor_namespaceObject.store);
} = select(external_wp_blocks_namespaceObject.store);
const editorSettings = getEditorSettings();
isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
hasV3BlocksOnly: getBlockTypes().every(type => {
return type.apiVersion >= 3;
isEditingTemplate: getCurrentPostType() === 'wp_template',
hasMetaBoxes: select(store).hasMetaBoxes()
return (hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme) && !hasMetaBoxes || isEditingTemplate;
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
useCommands: layout_useCommands
} = unlock(external_wp_coreCommands_namespaceObject.privateApis);
} = unlock(external_wp_commands_namespaceObject.privateApis);
} = unlock(external_wp_editor_namespaceObject.privateApis);
} = unlock(external_wp_blockLibrary_namespaceObject.privateApis);
const DESIGN_POST_TYPES = ['wp_template', 'wp_template_part', 'wp_block', 'wp_navigation'];
function useEditorStyles() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_blockEditor_namespaceObject.store);
} = select(external_wp_editor_namespaceObject.store);
const _postType = getCurrentPostType();
hasThemeStyleSupport: select(store).isFeatureActive('themeStyles'),
editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings(),
isZoomedOutView: __unstableGetEditorMode() === 'zoom-out',
renderingMode: getRenderingMode(),
// Compute the default styles.
return (0,external_wp_element_namespaceObject.useMemo)(() => {
var _editorSettings$style, _editorSettings$style2, _editorSettings$style3;
const presetStyles = (_editorSettings$style = editorSettings.styles?.filter(style => style.__unstableType && style.__unstableType !== 'theme')) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : [];
const defaultEditorStyles = [...editorSettings.defaultEditorStyles, ...presetStyles];
// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).
const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== ((_editorSettings$style2 = editorSettings.styles?.length) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0);
// If theme styles are not present or displayed, ensure that
// base layout styles are still present in the editor.
if (!editorSettings.disableLayoutStyles && !hasThemeStyles) {
defaultEditorStyles.push({
hasBlockGapSupport: false,
hasFallbackGapSupport: true,
fallbackGapValue: '0.5em'
const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles;
// Add a space for the typewriter effect. When typing in the last block,
// there needs to be room to scroll up.
if (!isZoomedOutView && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'
}, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, postType]);
const paddingAppenderRef = usePaddingAppender();
const shouldIframe = useShouldIframe();
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_preferences_namespaceObject.store);
} = select(external_wp_editor_namespaceObject.store);
mode: select(external_wp_editor_namespaceObject.store).getEditorMode(),
isFullscreenActive: select(store).isFeatureActive('fullscreenMode'),
hasActiveMetaboxes: select(store).hasMetaBoxes(),
hasBlockSelected: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart(),
showIconLabels: get('core', 'showIconLabels'),
isDistractionFree: get('core', 'distractionFree'),
showMetaBoxes: select(external_wp_editor_namespaceObject.store).getRenderingMode() === 'post-only',
hasHistory: !!getEditorSettings().onNavigateToPreviousEntityRecord,
isEditingTemplate: select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template',
isWelcomeGuideVisible: isFeatureActive('welcomeGuide')
// Set the right context for the command palette
const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit';
useCommandContext(commandContext);
const styles = useEditorStyles();
// We need to add the show-icon-labels class to the body element so it is applied to modals.
document.body.classList.add('show-icon-labels');
document.body.classList.remove('show-icon-labels');
const className = dist_clsx('edit-post-layout', 'is-mode-' + mode, {
'has-metaboxes': hasActiveMetaboxes
function onPluginAreaError(name) {
createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */
(0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onActionPerformed = (0,external_wp_element_namespaceObject.useCallback)((actionId, items) => {
document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
post_type: items[0].type,
const newItem = items[0];
const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Title of the created post e.g: "Post 1".
(0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), {
id: 'duplicate-post-action',
label: (0,external_wp_i18n_namespaceObject.__)('Edit'),
const postId = newItem.id;
document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', {
}, [createSuccessNotice]);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FullscreenMode, {
isActive: isFullscreenActive
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, {
onError: onPluginAreaError
}), !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Sidebar, {
onActionPerformed: onActionPerformed,
extraPanels: !isEditingTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(more_menu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInterface, {
forceIsDirty: hasActiveMetaboxes,
contentRef: paddingAppenderRef,
disableIframe: !shouldIframe
// We should auto-focus the canvas (title) on load.
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus: !isWelcomeGuideVisible,
children: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "edit-post-layout__metaboxes",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, {
/* harmony default export */ const layout = (Layout);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js
* This listener hook monitors any change in permalink and updates the view
* post link in the admin bar.
const useUpdatePostLinkListener = () => {
} = (0,external_wp_data_namespaceObject.useSelect)(select => ({
newPermalink: select(external_wp_editor_namespaceObject.store).getCurrentPost().link
const nodeToUpdate = (0,external_wp_element_namespaceObject.useRef)();
(0,external_wp_element_namespaceObject.useEffect)(() => {
nodeToUpdate.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!newPermalink || !nodeToUpdate.current) {
nodeToUpdate.current.setAttribute('href', newPermalink);
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js
* Data component used for initializing the editor and re-initializes
* when postId changes or on unmount.
* @return {null} This is a data component so does not render any ui.
function EditorInitialization() {
useUpdatePostLinkListener();
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js
* A hook that records the 'entity' history in the post editor as a user
* navigates between editing a post and editing the post template or patterns.
* Implemented as a stack, so a little similar to the browser history API.
* Used to control displaying UI elements like the back button.
* @param {number} initialPostId The post id of the post when the editor loaded.
* @param {string} initialPostType The post type of the post when the editor loaded.
* @param {string} defaultRenderingMode The rendering mode to switch to when navigating.
* @return {Object} An object containing the `currentPost` variable and
* `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.
function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) {
const [postHistory, dispatch] = (0,external_wp_element_namespaceObject.useReducer)((historyState, {
return [...historyState, {
// Try to leave one item in the history.
if (historyState.length > 1) {
return historyState.slice(0, -1);
postType: initialPostType
} = postHistory[postHistory.length - 1];
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store);