: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
children: [!!userAvatar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
alt: (0,external_wp_i18n_namespaceObject.__)('Avatar'),
className: "editor-post-locked-modal__avatar",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [!!isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: user's display name */
(0,external_wp_i18n_namespaceObject.__)('<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'), {
strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
children: (0,external_wp_i18n_namespaceObject.__)('preview')
}), !isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: user's display name */
(0,external_wp_i18n_namespaceObject.__)('<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'), userDisplayName) : (0,external_wp_i18n_namespaceObject.__)('Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'), {
strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
children: (0,external_wp_i18n_namespaceObject.__)('preview')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('If you take over, the other user will lose editing control to the post, but their changes will be saved.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
className: "editor-post-locked-modal__buttons",
children: [!isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
children: (0,external_wp_i18n_namespaceObject.__)('Take over')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js
* This component checks the publishing status of the current post.
* If the post is already published or the user doesn't have the
* capability to publish, it returns null.
* @param {Object} props Component properties.
* @param {Element} props.children Children to be rendered.
* @return {JSX.Element|null} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
function PostPendingStatusCheck({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getCurrentPost$_link;
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
isPublished: isCurrentPostPublished()
if (isPublished || !hasPublishAction) {
/* harmony default export */ const post_pending_status_check = (PostPendingStatusCheck);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js
* A component for displaying and toggling the pending status of a post.
* @return {JSX.Element} The rendered component.
function PostPendingStatus() {
const status = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('status'), []);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const togglePendingStatus = () => {
const updatedStatus = status === 'pending' ? 'draft' : 'pending';
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_pending_status_check, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Pending review'),
checked: status === 'pending',
onChange: togglePendingStatus
/* harmony default export */ const post_pending_status = (PostPendingStatus);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js
function writeInterstitialMessage(targetDocument) {
let markup = (0,external_wp_element_namespaceObject.renderToString)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-preview-button__interstitial-message",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
d: "M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('Generating preview…')
.editor-post-preview-button__interstitial-message {
@-webkit-keyframes paint {
.editor-post-preview-button__interstitial-message svg {
.editor-post-preview-button__interstitial-message svg .outer,
.editor-post-preview-button__interstitial-message svg .inner {
-webkit-animation: paint 1.5s ease infinite alternate;
-moz-animation: paint 1.5s ease infinite alternate;
-o-animation: paint 1.5s ease infinite alternate;
animation: paint 1.5s ease infinite alternate;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
* Filters the interstitial message shown when generating previews.
* @param {string} markup The preview interstitial markup.
markup = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostPreview.interstitialMarkup', markup);
targetDocument.write(markup);
targetDocument.title = (0,external_wp_i18n_namespaceObject.__)('Generating preview…');
* Renders a button that opens a new window or tab for the preview,
* writes the interstitial message to this window, and then navigates
* to the actual preview link. The button is not rendered if the post
* is not viewable and disabled if the post is not saveable.
* @param {Object} props The component props.
* @param {string} props.className The class name for the button.
* @param {string} props.textContent The text content for the button.
* @param {boolean} props.forceIsAutosaveable Whether to force autosave.
* @param {string} props.role The role attribute for the button.
* @param {Function} props.onPreview The callback function for preview event.
* @return {JSX.Element|null} The rendered button component.
function PostPreviewButton({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const editor = select(store_store);
const core = select(external_wp_coreData_namespaceObject.store);
const postType = core.getPostType(editor.getCurrentPostType('type'));
postId: editor.getCurrentPostId(),
currentPostLink: editor.getCurrentPostAttribute('link'),
previewLink: editor.getEditedPostPreviewLink(),
isSaveable: editor.isEditedPostSaveable(),
isViewable: (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const targetId = `wp-preview-${postId}`;
const openPreviewWindow = async event => {
// Our Preview button has its 'href' and 'target' set correctly for a11y
// purposes. Unfortunately, though, we can't rely on the default 'click'
// handler since sometimes it incorrectly opens a new tab instead of reusing
// https://github.com/WordPress/gutenberg/pull/8330
// Open up a Preview tab if needed. This is where we'll show the preview.
const previewWindow = window.open('', targetId);
// Focus the Preview tab. This might not do anything, depending on the browser's
// and user's preferences.
// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
writeInterstitialMessage(previewWindow.document);
const link = await __unstableSaveForPreview({
previewWindow.location = link;
// Link to the `?preview=true` URL if we have it, since this lets us see
// changes that were autosaved since the post was last published. Otherwise,
// just link to the post's URL.
const href = previewLink || currentPostLink;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
variant: !className ? 'tertiary' : undefined,
className: className || 'editor-post-preview',
__experimentalIsFocusable: true,
onClick: openPreviewWindow,
children: textContent || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject._x)('Preview', 'imperative verb'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
children: /* translators: accessibility text */
(0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js
function PublishButtonLabel() {
const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getCurrentPost$_link;
isEditedPostBeingScheduled,
isPublished: isCurrentPostPublished(),
isBeingScheduled: isEditedPostBeingScheduled(),
isSaving: isSavingPost(),
isPublishing: isPublishingPost(),
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
postType: getCurrentPostType(),
isAutosaving: isAutosavingPost(),
hasNonPostEntityChanges: select(store_store).hasNonPostEntityChanges(),
postStatusHasChanged: !!getPostEdits()?.status,
postStatus: getEditedPostAttribute('status')
/* translators: button label text should, if possible, be under 16 characters. */
return (0,external_wp_i18n_namespaceObject.__)('Publishing…');
} else if ((isPublished || isBeingScheduled) && isSaving && !isAutosaving) {
/* translators: button label text should, if possible, be under 16 characters. */
return (0,external_wp_i18n_namespaceObject.__)('Saving…');
// TODO: this is because "Submit for review" string is too long in some languages.
// @see https://github.com/WordPress/gutenberg/issues/10475
return isSmallerThanMediumViewport ? (0,external_wp_i18n_namespaceObject.__)('Publish') : (0,external_wp_i18n_namespaceObject.__)('Submit for Review');
if (hasNonPostEntityChanges || isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || !postStatusHasChanged && postStatus === 'future') {
return (0,external_wp_i18n_namespaceObject.__)('Save');
return (0,external_wp_i18n_namespaceObject.__)('Schedule');
return (0,external_wp_i18n_namespaceObject.__)('Publish');
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js
const post_publish_button_noop = () => {};
class PostPublishButton extends external_wp_element_namespaceObject.Component {
this.buttonNode = (0,external_wp_element_namespaceObject.createRef)();
this.createOnClick = this.createOnClick.bind(this);
this.closeEntitiesSavedStates = this.closeEntitiesSavedStates.bind(this);
entitiesSavedStatesCallback: false
if (this.props.focusOnMount) {
// This timeout is necessary to make sure the `useEffect` hook of
// `useFocusReturn` gets the correct element (the button that opens the
// PostPublishPanel) otherwise it will get this button.
this.timeoutID = setTimeout(() => {
this.buttonNode.current.focus();
clearTimeout(this.timeoutID);
createOnClick(callback) {
setEntitiesSavedStatesCallback
// If a post with non-post entities is published, but the user
// elects to not save changes to the non-post entities, those
// entities will still be dirty when the Publish button is clicked.
// We also need to check that the `setEntitiesSavedStatesCallback`
// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
// The modal for multiple entity saving will open,
// hold the callback for saving/publishing the post
// so that we can call it if the post entity is checked.
entitiesSavedStatesCallback: () => callback(...args)
// Open the save panel by setting its callback.
// To set a function on the useState hook, we must set it
// with another function (() => myFunction). Passing the
// function on its own will cause an error when called.
setEntitiesSavedStatesCallback(() => this.closeEntitiesSavedStates);
return post_publish_button_noop;
return callback(...args);
closeEntitiesSavedStates(savedEntities) {
entitiesSavedStatesCallback
entitiesSavedStatesCallback: false
if (savedEntities && savedEntities.some(elt => elt.kind === 'postType' && elt.name === postType && elt.key === postId)) {
// The post entity was checked, call the held callback from `createOnClick`.
entitiesSavedStatesCallback();