: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/check.js
function PostFormatCheck({
const disablePostFormats = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditorSettings().disablePostFormats, []);
if (disablePostFormats) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
supportKeys: "post-formats",
* Component check if there are any post formats.
* @param {Object} props The component props.
* @param {Element} props.children The child elements to render.
* @return {Component|null} The rendered component or null if post formats are disabled.
/* harmony default export */ const post_format_check = (PostFormatCheck);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-format/index.js
// All WP post formats, sorted alphabetically by translated name.
caption: (0,external_wp_i18n_namespaceObject.__)('Aside')
caption: (0,external_wp_i18n_namespaceObject.__)('Audio')
caption: (0,external_wp_i18n_namespaceObject.__)('Chat')
caption: (0,external_wp_i18n_namespaceObject.__)('Gallery')
caption: (0,external_wp_i18n_namespaceObject.__)('Image')
caption: (0,external_wp_i18n_namespaceObject.__)('Link')
caption: (0,external_wp_i18n_namespaceObject.__)('Quote')
caption: (0,external_wp_i18n_namespaceObject.__)('Standard')
caption: (0,external_wp_i18n_namespaceObject.__)('Status')
caption: (0,external_wp_i18n_namespaceObject.__)('Video')
const normalizedA = a.caption.toUpperCase();
const normalizedB = b.caption.toUpperCase();
if (normalizedA < normalizedB) {
if (normalizedA > normalizedB) {
* `PostFormat` a component that allows changing the post format while also providing a suggestion for the current post.
* @return {JSX.Element} The rendered PostFormat component.
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostFormat);
const postFormatSelectorId = `post-format-selector-${instanceId}`;
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const _postFormat = getEditedPostAttribute('format');
const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports();
postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard',
suggestedFormat: getSuggestedPostFormat(),
supportedFormats: themeSupports.formats
const formats = POST_FORMATS.filter(format => {
// Ensure current format is always in the set.
// The current format may not be a format supported by the theme.
return supportedFormats?.includes(format.id) || postFormat === format.id;
const suggestion = formats.find(format => format.id === suggestedFormat);
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const onUpdatePostFormat = format => editPost({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_format_check, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-format",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
className: "editor-post-format__options",
label: (0,external_wp_i18n_namespaceObject.__)('Post Format'),
onChange: format => onUpdatePostFormat(format),
id: postFormatSelectorId,
options: formats.map(format => ({
hideLabelFromVision: true
}), suggestion && suggestion.id !== postFormat && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "editor-post-format__suggestion",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
onClick: () => onUpdatePostFormat(suggestion.id),
children: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: post format */
(0,external_wp_i18n_namespaceObject.__)('Apply suggested format: %s'), suggestion.caption)
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/backup.js
const backup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"
/* harmony default export */ const library_backup = (backup);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/check.js
* Wrapper component that renders its children if the post has more than one revision.
* @param {Object} props Props.
* @param {Element} props.children Children to be rendered.
* @return {Component|null} Rendered child components if post has more than one revision, otherwise null.
function PostLastRevisionCheck({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getCurrentPostLastRevisionId,
getCurrentPostRevisionsCount
lastRevisionId: getCurrentPostLastRevisionId(),
revisionsCount: getCurrentPostRevisionsCount()
if (!lastRevisionId || revisionsCount < 2) {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
supportKeys: "revisions",
/* harmony default export */ const post_last_revision_check = (PostLastRevisionCheck);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/index.js
function usePostLastRevisionInfo() {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
getCurrentPostLastRevisionId,
getCurrentPostRevisionsCount
lastRevisionId: getCurrentPostLastRevisionId(),
revisionsCount: getCurrentPostRevisionsCount()
* Renders the component for displaying the last revision of a post.
* @return {Component} The component to be rendered.
function PostLastRevision() {
} = usePostLastRevisionInfo();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
href: (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', {
className: "editor-post-last-revision__title",
text: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: number of revisions */
(0,external_wp_i18n_namespaceObject.__)('Revisions (%s)'), revisionsCount)
function PrivatePostLastRevision() {
} = usePostLastRevisionInfo();
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Revisions'),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
href: (0,external_wp_url_namespaceObject.addQueryArgs)('revision.php', {
className: "editor-private-post-last-revision__button",
/* harmony default export */ const post_last_revision = (PostLastRevision);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-last-revision/panel.js
* Renders the panel for displaying the last revision of a post.
* @return {Component} The component to be rendered.
function PostLastRevisionPanel() {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision_check, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
className: "editor-post-last-revision__panel",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_last_revision, {})
/* harmony default export */ const post_last_revision_panel = (PostLastRevisionPanel);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-locked-modal/index.js
* A modal component that is displayed when a post is locked for editing by another user.
* The modal provides information about the lock status and options to take over or exit the editor.
* @return {JSX.Element|null} The rendered PostLockedModal component.
function PostLockedModal() {
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostLockedModal);
const hookName = 'core/editor/post-locked-modal-' + instanceId;
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
getEditedPostPreviewLink,
} = select(external_wp_coreData_namespaceObject.store);
isLocked: isPostLocked(),
isTakeover: isPostLockTakeover(),
postId: getCurrentPostId(),
postLockUtils: getEditorSettings().postLockUtils,
activePostLock: getActivePostLock(),
postType: getPostType(getEditedPostAttribute('type')),
previewLink: getEditedPostPreviewLink()
(0,external_wp_element_namespaceObject.useEffect)(() => {
* Keep the lock refreshed.
* When the user does not send a heartbeat in a heartbeat-tick
* the user is no longer editing and another user can start editing.
* @param {Object} data Data to send in the heartbeat request.
function sendPostLock(data) {
data['wp-refresh-post-lock'] = {
* Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.
* @param {Object} data Data received in the heartbeat request
function receivePostLock(data) {
if (!data['wp-refresh-post-lock']) {
const received = data['wp-refresh-post-lock'];
if (received.lock_error) {
// Auto save and display the takeover modal.
name: received.lock_error.name,
avatar: received.lock_error.avatar_src_2x
} else if (received.new_lock) {
activePostLock: received.new_lock
* Unlock the post before the window is exited.
function releasePostLock() {
if (isLocked || !activePostLock) {
const data = new window.FormData();
data.append('action', 'wp-remove-post-lock');
data.append('_wpnonce', postLockUtils.unlockNonce);
data.append('post_ID', postId);
data.append('active_post_lock', activePostLock);
if (window.navigator.sendBeacon) {
window.navigator.sendBeacon(postLockUtils.ajaxUrl, data);
const xhr = new window.XMLHttpRequest();
xhr.open('POST', postLockUtils.ajaxUrl, false);
// Details on these events on the Heartbeat API docs
// https://developer.wordpress.org/plugins/javascript/heartbeat-api/
(0,external_wp_hooks_namespaceObject.addAction)('heartbeat.send', hookName, sendPostLock);
(0,external_wp_hooks_namespaceObject.addAction)('heartbeat.tick', hookName, receivePostLock);
window.addEventListener('beforeunload', releasePostLock);
(0,external_wp_hooks_namespaceObject.removeAction)('heartbeat.send', hookName);
(0,external_wp_hooks_namespaceObject.removeAction)('heartbeat.tick', hookName);
window.removeEventListener('beforeunload', releasePostLock);
const userDisplayName = user.name;
const userAvatar = user.avatar;
const unlockUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', {
_wpnonce: postLockUtils.nonce
const allPostsUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
post_type: postType?.slug
const allPostsLabel = (0,external_wp_i18n_namespaceObject.__)('Exit editor');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
title: isTakeover ? (0,external_wp_i18n_namespaceObject.__)('Someone else has taken over this post') : (0,external_wp_i18n_namespaceObject.__)('This post is already being edited'),
shouldCloseOnClickOutside: false,