: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getCurrentPost$_link;
} = select(external_wp_preferences_namespaceObject.store);
isAutosaving: isAutosavingPost(),
isDirty: forceIsDirty || isEditedPostDirty(),
isNew: isEditedPostNew(),
isPublished: isCurrentPostPublished(),
isSaving: isSavingPost(),
isSaveable: isEditedPostSaveable(),
isScheduled: isCurrentPostScheduled(),
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()?._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
showIconLabels: get('core', 'showIconLabels'),
postStatus: getEditedPostAttribute('status'),
postStatusHasChanged: !!getPostEdits()?.status
const isPending = postStatus === 'pending';
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const wasSaving = (0,external_wp_compose_namespaceObject.usePrevious)(isSaving);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (wasSaving && !isSaving) {
setForceSavedMessage(true);
timeoutId = setTimeout(() => {
setForceSavedMessage(false);
return () => clearTimeout(timeoutId);
// Once the post has been submitted for review this button
// is not needed for the contributor role.
if (!hasPublishAction && isPending) {
// We shouldn't render the button if the post has not one of the following statuses: pending, draft, auto-draft.
// The reason for this is that this button handles the `save as pending` and `save draft` actions.
// An exception for this is when the post has a custom status and there should be a way to save changes without
// having to publish. This should be handled better in the future when custom statuses have better support.
// @see https://github.com/WordPress/gutenberg/issues/3144.
const isIneligibleStatus = !['pending', 'draft', 'auto-draft'].includes(postStatus) && STATUS_OPTIONS.map(({
}) => value).includes(postStatus);
if (isPublished || isScheduled || isIneligibleStatus || postStatusHasChanged && ['pending', 'draft'].includes(postStatus)) {
/* translators: button label text should, if possible, be under 16 characters. */
const label = isPending ? (0,external_wp_i18n_namespaceObject.__)('Save as pending') : (0,external_wp_i18n_namespaceObject.__)('Save draft');
/* translators: button label text should, if possible, be under 16 characters. */
const shortLabel = (0,external_wp_i18n_namespaceObject.__)('Save');
const isSaved = forceSavedMessage || !isNew && !isDirty;
const isSavedState = isSaving || isSaved;
const isDisabled = isSaving || isSaved || !isSaveable;
text = isAutosaving ? (0,external_wp_i18n_namespaceObject.__)('Autosaving') : (0,external_wp_i18n_namespaceObject.__)('Saving');
text = (0,external_wp_i18n_namespaceObject.__)('Saved');
} else if (isLargeViewport) {
} else if (showIconLabels) {
// Use common Button instance for all saved states so that focus is not
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, {
className: isSaveable || isSaving ? dist_clsx({
'editor-post-save-draft': !isSavedState,
'editor-post-saved-state': isSavedState,
'is-autosaving': isAutosaving,
[(0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({
onClick: isDisabled ? undefined : () => savePost()
* We want the tooltip to show the keyboard shortcut only when the
* button does something, i.e. when it's not disabled.
shortcut: isDisabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s'),
icon: isLargeViewport ? undefined : cloud_upload,
"aria-disabled": isDisabled,
children: [isSavedState && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icon, {
icon: isSaved ? library_check : library_cloud
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-schedule/check.js
* Wrapper component that renders its children only if post has a publish action.
* @param {Object} props Props.
* @param {Element} props.children Children to be rendered.
* @return {Component} - The component to be rendered or null if there is no publish action.
function PostScheduleCheck({
const hasPublishAction = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$getCurrentPos;
return (_select$getCurrentPos = select(store_store).getCurrentPost()._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false;
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-schedule/panel.js
const panel_DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE];
* Renders the Post Schedule Panel component.
* @return {Component} The component to be rendered.
function PostSchedulePanel() {
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
const postType = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getCurrentPostType(), []);
// 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.
'aria-label': (0,external_wp_i18n_namespaceObject.__)('Change publish date'),
const label = usePostScheduleLabel();
const fullLabel = usePostScheduleLabel({
if (panel_DESIGN_POST_TYPES.includes(postType)) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleCheck, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Publish'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: popoverProps,
className: "editor-post-schedule__panel-dropdown",
contentClassName: "editor-post-schedule__dialog",
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "editor-post-schedule__dialog-toggle",
tooltipPosition: "middle left",
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Current post date.
(0,external_wp_i18n_namespaceObject.__)('Change date: %s'), label),
showTooltip: label !== fullLabel,
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedule, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-slug/check.js
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-slug/index.js
function PostSlugControl() {
const postSlug = (0,external_wp_data_namespaceObject.useSelect)(select => {
return (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(select(store_store).getEditedPostSlug());
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const [forceEmptyField, setForceEmptyField] = (0,external_wp_element_namespaceObject.useState)(false);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Slug'),
value: forceEmptyField ? '' : postSlug,
// When we delete the field the permalink gets
// reverted to the original value.
// The forceEmptyField logic allows the user to have
// the field temporarily empty while typing.
setForceEmptyField(true);
setForceEmptyField(false);
slug: (0,external_wp_url_namespaceObject.cleanForSlug)(event.target.value)
setForceEmptyField(false);
className: "editor-post-slug"
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSlugCheck, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSlugControl, {})
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-sticky/check.js
function PostStickyCheck({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _post$_links$wpActio;
const post = select(store_store).getCurrentPost();
hasStickyAction: (_post$_links$wpActio = post._links?.['wp:action-sticky']) !== null && _post$_links$wpActio !== void 0 ? _post$_links$wpActio : false,
postType: select(store_store).getCurrentPostType()
if (postType !== 'post' || !hasStickyAction) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-sticky/index.js
const postSticky = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$getEditedPost;
return (_select$getEditedPost = select(store_store).getEditedPostAttribute('sticky')) !== null && _select$getEditedPost !== void 0 ? _select$getEditedPost : false;
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostStickyCheck, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Sticky'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
className: "editor-post-sticky__toggle-control",
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
children: (0,external_wp_i18n_namespaceObject.__)('Sticky')
onChange: () => editPost({
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-switch-to-draft-button/index.js
function PostSwitchToDraftButton() {
const [showConfirmDialog, setShowConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
isSaving: isSavingPost(),
isPublished: isCurrentPostPublished(),
isScheduled: isCurrentPostScheduled()
const isDisabled = isSaving || !isPublished && !isScheduled;
alertMessage = (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to unpublish this post?');
confirmButtonText = (0,external_wp_i18n_namespaceObject.__)('Unpublish');
} else if (isScheduled) {
alertMessage = (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to unschedule this post?');
confirmButtonText = (0,external_wp_i18n_namespaceObject.__)('Unschedule');
const handleConfirm = () => {
setShowConfirmDialog(false);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
__next40pxDefaultSize: true,
className: "editor-post-switch-to-draft",
setShowConfirmDialog(true);
"aria-disabled": isDisabled,
children: (0,external_wp_i18n_namespaceObject.__)('Switch to draft')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
isOpen: showConfirmDialog,
onConfirm: handleConfirm,
onCancel: () => setShowConfirmDialog(false),
confirmButtonText: confirmButtonText,
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-sync-status/index.js
function PostSyncStatus() {
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const meta = getEditedPostAttribute('meta');
// When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
const currentSyncStatus = meta?.wp_pattern_sync_status === 'unsynced' ? 'unsynced' : getEditedPostAttribute('wp_pattern_sync_status');
syncStatus: currentSyncStatus,
postType: getEditedPostAttribute('type')