: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
getEditorSettings: _getEditorSettings
} = unlock(select(store_store));
const editorSettings = _getEditorSettings();
isTemplateHidden: getRenderingMode() === 'post-only',
onNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,
getEditorSettings: _getEditorSettings,
hasGoBack: editorSettings.hasOwnProperty('onNavigateToPreviousEntityRecord')
} = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_template', id);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const canCreateTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => {
return (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false;
// The site editor does not have a `onNavigateToPreviousEntityRecord` setting as it uses its own routing
// and assigns its own backlink to focusMode pages.
const notificationAction = hasGoBack ? [{
label: (0,external_wp_i18n_namespaceObject.__)('Go back'),
onClick: () => getEditorSettings().onNavigateToPreviousEntityRecord()
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, {
popoverProps: block_theme_POPOVER_PROPS,
tooltipPosition: 'middle left'
label: (0,external_wp_i18n_namespaceObject.__)('Template options'),
text: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(template.title),
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, {
children: [canCreateTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
onNavigateToEntityRecord({
createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Editing template. Changes made here affect all posts and pages that use the template.'), {
actions: notificationAction
children: (0,external_wp_i18n_namespaceObject.__)('Edit template')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SwapTemplateButton, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResetDefaultTemplate, {
}), canCreateTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CreateNewTemplate, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
icon: !isTemplateHidden ? library_check : undefined,
isSelected: !isTemplateHidden,
role: "menuitemcheckbox",
setRenderingMode(isTemplateHidden ? 'template-locked' : 'post-only');
children: (0,external_wp_i18n_namespaceObject.__)('Show template')
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-template/panel.js
* Displays the template controls based on the current editor settings and user permissions.
* @return {JSX.Element|null} The rendered PostTemplatePanel component.
function PostTemplatePanel() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
templateId: getCurrentTemplateId(),
isBlockTheme: getEditorSettings().__unstableIsBlockBasedTheme
const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
const postTypeSlug = select(store_store).getCurrentPostType();
const postType = select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug);
if (!postType?.viewable) {
const settings = select(store_store).getEditorSettings();
const hasTemplates = !!settings.availableTemplates && Object.keys(settings.availableTemplates).length > 0;
if (!settings.supportsTemplateMode) {
const canCreateTemplates = (_select$canUser = select(external_wp_coreData_namespaceObject.store).canUser('create', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false;
return canCreateTemplates;
const canViewTemplates = (0,external_wp_data_namespaceObject.useSelect)(select => {
return (_select$canUser2 = select(external_wp_coreData_namespaceObject.store).canUser('read', 'templates')) !== null && _select$canUser2 !== void 0 ? _select$canUser2 : false;
if ((!isBlockTheme || !canViewTemplates) && isVisible) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Template'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(classic_theme, {})
if (isBlockTheme && !!templateId) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Template'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockThemeControl, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/constants.js
context: 'view' // Allows non-admins to perform requests.
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/hook.js
function useAuthorsQuery(search) {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
const _authorId = getEditedPostAttribute('author');
authors: getUsers(query),
postAuthor: getUser(_authorId, BASE_QUERY)
const authorOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
const fetchedAuthors = (authors !== null && authors !== void 0 ? authors : []).map(author => {
label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(author.name)
// Ensure the current author is included in the dropdown list.
const foundAuthor = fetchedAuthors.findIndex(({
}) => postAuthor?.id === value);
if (foundAuthor < 0 && postAuthor) {
label: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postAuthor.name)
}, [authors, postAuthor]);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/combobox.js
function PostAuthorCombobox() {
const [fieldValue, setFieldValue] = (0,external_wp_element_namespaceObject.useState)();
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = useAuthorsQuery(fieldValue);
* Handle author selection.
* @param {number} postAuthorId The selected Author.
const handleSelect = postAuthorId => {
* @param {string} inputValue The current value of the input field.
const handleKeydown = inputValue => {
setFieldValue(inputValue);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, {
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
label: (0,external_wp_i18n_namespaceObject.__)('Author'),
onFilterValueChange: (0,external_wp_compose_namespaceObject.debounce)(handleKeydown, 300),
hideLabelFromVision: true
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/select.js
function PostAuthorSelect() {
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const setAuthorId = value => {
const author = Number(value);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, {
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true,
className: "post-author-selector",
label: (0,external_wp_i18n_namespaceObject.__)('Author'),
hideLabelFromVision: true
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/index.js
const minimumUsersForCombobox = 25;
* Renders the component for selecting the post author.
* @return {Component} The component to be rendered.
const showCombobox = (0,external_wp_data_namespaceObject.useSelect)(select => {
const authors = select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY);
return authors?.length >= minimumUsersForCombobox;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorCombobox, {});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorSelect, {});
/* harmony default export */ const post_author = (PostAuthor);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/check.js
* Wrapper component that renders its children only if the post type supports the author.
* @param {Object} props The component props.
* @param {Element} props.children Children to be rendered.
* @return {Component|null} The component to be rendered. Return `null` if the post type doesn't
* supports the author or if there are no authors available.
function PostAuthorCheck({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _post$_links$wpActio;
const post = select(store_store).getCurrentPost();
const authors = select(external_wp_coreData_namespaceObject.store).getUsers(AUTHORS_QUERY);
hasAssignAuthorAction: (_post$_links$wpActio = post._links?.['wp:action-assign-author']) !== null && _post$_links$wpActio !== void 0 ? _post$_links$wpActio : false,
hasAuthors: authors?.length >= 1
if (!hasAssignAuthorAction || !hasAuthors) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-author/panel.js
function PostAuthorToggle({
const authorName = postAuthor?.name || '';
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "editor-post-author__panel-toggle",
// translators: %s: Current post link.
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Change author: %s'), authorName),
* Renders the Post Author Panel component.
* @return {Component} The component to be rendered.
function panel_PostAuthor() {
// Use internal state instead of a ref to make sure that the component
// re-renders when the popover's anchor updates.
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
// Memoize popoverProps to avoid returning a new object every time.
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
// Anchor the popover to the middle of the entire row so that it doesn't
// move around when the label changes.
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorCheck, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Author'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: popoverProps,
contentClassName: "editor-post-author__panel-dialog",
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostAuthorToggle, {
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-author",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
title: (0,external_wp_i18n_namespaceObject.__)('Author'),
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_author, {