: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
children: newTermSubmitLabel
/* harmony default export */ const hierarchical_term_selector = ((0,external_wp_components_namespaceObject.withFilters)('editor.PostTaxonomyType')(HierarchicalTermSelector));
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-category-panel.js
function MaybeCategoryPanel() {
const hasNoCategory = (0,external_wp_data_namespaceObject.useSelect)(select => {
const postType = select(store_store).getCurrentPostType();
} = select(external_wp_coreData_namespaceObject.store);
const categoriesTaxonomy = getTaxonomy('category');
const defaultCategoryId = canUser('read', 'settings') ? getEntityRecord('root', 'site')?.default_category : undefined;
const defaultCategory = defaultCategoryId ? getEntityRecord('taxonomy', 'category', defaultCategoryId) : undefined;
const postTypeSupportsCategories = categoriesTaxonomy && categoriesTaxonomy.types.some(type => type === postType);
const categories = categoriesTaxonomy && select(store_store).getEditedPostAttribute(categoriesTaxonomy.rest_base);
// This boolean should return true if everything is loaded
// ( categoriesTaxonomy, defaultCategory )
// and the post has not been assigned a category different than "uncategorized".
return !!categoriesTaxonomy && !!defaultCategory && postTypeSupportsCategories && (categories?.length === 0 || categories?.length === 1 && defaultCategory?.id === categories[0]);
const [shouldShowPanel, setShouldShowPanel] = (0,external_wp_element_namespaceObject.useState)(false);
(0,external_wp_element_namespaceObject.useEffect)(() => {
// We use state to avoid hiding the panel if the user edits the categories
// and adds one within the panel itself (while visible).
setShouldShowPanel(true);
const panelBodyTitle = [(0,external_wp_i18n_namespaceObject.__)('Suggestion:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "editor-post-publish-panel__link",
children: (0,external_wp_i18n_namespaceObject.__)('Assign a category')
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(hierarchical_term_selector, {
/* harmony default export */ const maybe_category_panel = (MaybeCategoryPanel);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/maybe-upload-media.js
function flattenBlocks(blocks) {
blocks.forEach(block => {
result.push(...flattenBlocks(block.innerBlocks));
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.img, {
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Select image block.'),
selectBlock(block.clientId);
if (event.key === 'Enter' || event.key === ' ') {
selectBlock(block.clientId);
alt: block.attributes.alt,
src: block.attributes.url,
function maybe_upload_media_PostFormatPanel() {
const [isUploading, setIsUploading] = (0,external_wp_element_namespaceObject.useState)(false);
} = (0,external_wp_data_namespaceObject.useSelect)(select => ({
editorBlocks: select(store_store).getEditorBlocks(),
mediaUpload: select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload
const externalImages = flattenBlocks(editorBlocks).filter(block => block.name === 'core/image' && block.attributes.url && !block.attributes.id);
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
if (!mediaUpload || !externalImages.length) {
const panelBodyTitle = [(0,external_wp_i18n_namespaceObject.__)('Suggestion:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "editor-post-publish-panel__link",
children: (0,external_wp_i18n_namespaceObject.__)('External media')
function uploadImages() {
Promise.all(externalImages.map(image => window.fetch(image.attributes.url.includes('?') ? image.attributes.url : image.attributes.url + '?').then(response => response.blob()).then(blob => new Promise((resolve, reject) => {
onFileChange: ([media]) => {
if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
updateBlockAttributes(image.clientId, {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: (0,external_wp_i18n_namespaceObject.__)('Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
children: externalImages.map(image => {
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Image, {
}), isUploading ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
children: (0,external_wp_i18n_namespaceObject.__)('Upload')
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/prepublish.js
function PostPublishPanelPrepublish({
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getCurrentPost$_link;
isEditedPostBeingScheduled
} = select(external_wp_coreData_namespaceObject.store);
const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
isBeingScheduled: isEditedPostBeingScheduled(),
isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]),
siteIconUrl: siteData.site_icon_url,
siteTitle: siteData.name,
siteHome: siteData.home && (0,external_wp_url_namespaceObject.filterURLForDisplay)(siteData.home)
let siteIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
className: "components-site-icon",
siteIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'),
className: "components-site-icon",
if (isRequestingSiteIcon) {
let prePublishTitle, prePublishBodyText;
prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to submit for review?');
prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('When you’re ready, submit your work for review, and an Editor will be able to approve it for you.');
} else if (isBeingScheduled) {
prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to schedule?');
prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('Your work will be published at the specified date and time.');
prePublishTitle = (0,external_wp_i18n_namespaceObject.__)('Are you ready to publish?');
prePublishBodyText = (0,external_wp_i18n_namespaceObject.__)('Double-check your settings before publishing.');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-publish-panel__prepublish",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
children: prePublishTitle
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
children: prePublishBodyText
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-site-card",
children: [siteIcon, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "components-site-info",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-site-name",
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle) || (0,external_wp_i18n_namespaceObject.__)('(Untitled)')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "components-site-home",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(maybe_upload_media_PostFormatPanel, {}), hasPublishAction && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: [(0,external_wp_i18n_namespaceObject.__)('Visibility:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "editor-post-publish-panel__link",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityLabel, {})
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibility, {})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
title: [(0,external_wp_i18n_namespaceObject.__)('Publish:'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", {
className: "editor-post-publish-panel__link",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {})
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostSchedule, {})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostFormatPanel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(maybe_tags_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(maybe_category_panel, {}), children]
/* harmony default export */ const prepublish = (PostPublishPanelPrepublish);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/postpublish.js
const POSTNAME = '%postname%';
const PAGENAME = '%pagename%';
* Returns URL for a future post.
* @param {Object} post Post object.
* @return {string} PostPublish URL.
const getFuturePostUrl = post => {
if (post.permalink_template.includes(POSTNAME)) {
return post.permalink_template.replace(POSTNAME, slug);
if (post.permalink_template.includes(PAGENAME)) {
return post.permalink_template.replace(PAGENAME, slug);
return post.permalink_template;
function postpublish_CopyButton({
const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, onCopy);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
class PostPublishPanelPostpublish extends external_wp_element_namespaceObject.Component {
showCopyConfirmation: false
this.onCopy = this.onCopy.bind(this);
this.onSelectInput = this.onSelectInput.bind(this);
this.postLink = (0,external_wp_element_namespaceObject.createRef)();
if (this.props.focusOnMount) {
this.postLink.current.focus();
clearTimeout(this.dismissCopyConfirmation);
showCopyConfirmation: true
clearTimeout(this.dismissCopyConfirmation);
this.dismissCopyConfirmation = setTimeout(() => {
showCopyConfirmation: false
const postLabel = postType?.labels?.singular_name;
const viewPostLabel = postType?.labels?.view_item;
const addNewPostLabel = postType?.labels?.add_new_item;
const link = post.status === 'future' ? getFuturePostUrl(post) : post.link;
const addLink = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', {
const postPublishNonLinkHeader = isScheduled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('is now scheduled. It will go live on'), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleLabel, {}), "."]
}) : (0,external_wp_i18n_namespaceObject.__)('is now live.');
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "post-publish-panel__postpublish",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
className: "post-publish-panel__postpublish-header",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", {
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post.title) || (0,external_wp_i18n_namespaceObject.__)('(no title)')
}), ' ', postPublishNonLinkHeader]
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
className: "post-publish-panel__postpublish-subheader",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {
children: (0,external_wp_i18n_namespaceObject.__)('What’s next?')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "post-publish-panel__postpublish-post-address-container",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
__nextHasNoMarginBottom: true,
className: "post-publish-panel__postpublish-post-address",
label: (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: post type singular name */
(0,external_wp_i18n_namespaceObject.__)('%s address'), postLabel),
value: (0,external_wp_url_namespaceObject.safeDecodeURIComponent)(link),
onFocus: this.onSelectInput
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "post-publish-panel__postpublish-post-address__copy-button-wrap",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(postpublish_CopyButton, {
children: this.state.showCopyConfirmation ? (0,external_wp_i18n_namespaceObject.__)('Copied!') : (0,external_wp_i18n_namespaceObject.__)('Copy')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "post-publish-panel__postpublish-buttons",
children: [!isScheduled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
variant: isScheduled ? 'primary' : 'secondary',
children: addNewPostLabel
/* harmony default export */ const postpublish = ((0,external_wp_data_namespaceObject.withSelect)(select => {
} = select(external_wp_coreData_namespaceObject.store);
postType: getPostType(getEditedPostAttribute('type')),
isScheduled: isCurrentPostScheduled()
})(PostPublishPanelPostpublish));
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-panel/index.js