Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: editor.js
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[13500] Fix | Delete
alignment: "top",
[13501] Fix | Delete
spacing: 6,
[13502] Fix | Delete
children: [!!userAvatar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
[13503] Fix | Delete
src: userAvatar,
[13504] Fix | Delete
alt: (0,external_wp_i18n_namespaceObject.__)('Avatar'),
[13505] Fix | Delete
className: "editor-post-locked-modal__avatar",
[13506] Fix | Delete
width: 64,
[13507] Fix | Delete
height: 64
[13508] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[13509] Fix | Delete
children: [!!isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[13510] Fix | Delete
children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: user's display name */
[13511] Fix | Delete
(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.'), {
[13512] Fix | Delete
strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
[13513] Fix | Delete
PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
[13514] Fix | Delete
href: previewLink,
[13515] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('preview')
[13516] Fix | Delete
})
[13517] Fix | Delete
})
[13518] Fix | Delete
}), !isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[13519] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[13520] Fix | Delete
children: (0,external_wp_element_namespaceObject.createInterpolateElement)(userDisplayName ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: user's display name */
[13521] Fix | Delete
(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.'), {
[13522] Fix | Delete
strong: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", {}),
[13523] Fix | Delete
PreviewLink: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
[13524] Fix | Delete
href: previewLink,
[13525] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('preview')
[13526] Fix | Delete
})
[13527] Fix | Delete
})
[13528] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[13529] Fix | Delete
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.')
[13530] Fix | Delete
})]
[13531] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[13532] Fix | Delete
className: "editor-post-locked-modal__buttons",
[13533] Fix | Delete
justify: "flex-end",
[13534] Fix | Delete
children: [!isTakeover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[13535] Fix | Delete
variant: "tertiary",
[13536] Fix | Delete
href: unlockUrl,
[13537] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Take over')
[13538] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[13539] Fix | Delete
variant: "primary",
[13540] Fix | Delete
href: allPostsUrl,
[13541] Fix | Delete
children: allPostsLabel
[13542] Fix | Delete
})]
[13543] Fix | Delete
})]
[13544] Fix | Delete
})]
[13545] Fix | Delete
})
[13546] Fix | Delete
});
[13547] Fix | Delete
}
[13548] Fix | Delete
[13549] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-pending-status/check.js
[13550] Fix | Delete
/**
[13551] Fix | Delete
* WordPress dependencies
[13552] Fix | Delete
*/
[13553] Fix | Delete
[13554] Fix | Delete
[13555] Fix | Delete
/**
[13556] Fix | Delete
* Internal dependencies
[13557] Fix | Delete
*/
[13558] Fix | Delete
[13559] Fix | Delete
[13560] Fix | Delete
/**
[13561] Fix | Delete
* This component checks the publishing status of the current post.
[13562] Fix | Delete
* If the post is already published or the user doesn't have the
[13563] Fix | Delete
* capability to publish, it returns null.
[13564] Fix | Delete
*
[13565] Fix | Delete
* @param {Object} props Component properties.
[13566] Fix | Delete
* @param {Element} props.children Children to be rendered.
[13567] Fix | Delete
*
[13568] Fix | Delete
* @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.
[13569] Fix | Delete
*/
[13570] Fix | Delete
function PostPendingStatusCheck({
[13571] Fix | Delete
children
[13572] Fix | Delete
}) {
[13573] Fix | Delete
const {
[13574] Fix | Delete
hasPublishAction,
[13575] Fix | Delete
isPublished
[13576] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[13577] Fix | Delete
var _getCurrentPost$_link;
[13578] Fix | Delete
const {
[13579] Fix | Delete
isCurrentPostPublished,
[13580] Fix | Delete
getCurrentPost
[13581] Fix | Delete
} = select(store_store);
[13582] Fix | Delete
return {
[13583] Fix | Delete
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
[13584] Fix | Delete
isPublished: isCurrentPostPublished()
[13585] Fix | Delete
};
[13586] Fix | Delete
}, []);
[13587] Fix | Delete
if (isPublished || !hasPublishAction) {
[13588] Fix | Delete
return null;
[13589] Fix | Delete
}
[13590] Fix | Delete
return children;
[13591] Fix | Delete
}
[13592] Fix | Delete
/* harmony default export */ const post_pending_status_check = (PostPendingStatusCheck);
[13593] Fix | Delete
[13594] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-pending-status/index.js
[13595] Fix | Delete
/**
[13596] Fix | Delete
* WordPress dependencies
[13597] Fix | Delete
*/
[13598] Fix | Delete
[13599] Fix | Delete
[13600] Fix | Delete
[13601] Fix | Delete
[13602] Fix | Delete
/**
[13603] Fix | Delete
* Internal dependencies
[13604] Fix | Delete
*/
[13605] Fix | Delete
[13606] Fix | Delete
[13607] Fix | Delete
[13608] Fix | Delete
/**
[13609] Fix | Delete
* A component for displaying and toggling the pending status of a post.
[13610] Fix | Delete
*
[13611] Fix | Delete
* @return {JSX.Element} The rendered component.
[13612] Fix | Delete
*/
[13613] Fix | Delete
[13614] Fix | Delete
function PostPendingStatus() {
[13615] Fix | Delete
const status = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostAttribute('status'), []);
[13616] Fix | Delete
const {
[13617] Fix | Delete
editPost
[13618] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
[13619] Fix | Delete
const togglePendingStatus = () => {
[13620] Fix | Delete
const updatedStatus = status === 'pending' ? 'draft' : 'pending';
[13621] Fix | Delete
editPost({
[13622] Fix | Delete
status: updatedStatus
[13623] Fix | Delete
});
[13624] Fix | Delete
};
[13625] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_pending_status_check, {
[13626] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
[13627] Fix | Delete
__nextHasNoMarginBottom: true,
[13628] Fix | Delete
label: (0,external_wp_i18n_namespaceObject.__)('Pending review'),
[13629] Fix | Delete
checked: status === 'pending',
[13630] Fix | Delete
onChange: togglePendingStatus
[13631] Fix | Delete
})
[13632] Fix | Delete
});
[13633] Fix | Delete
}
[13634] Fix | Delete
/* harmony default export */ const post_pending_status = (PostPendingStatus);
[13635] Fix | Delete
[13636] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-preview-button/index.js
[13637] Fix | Delete
/**
[13638] Fix | Delete
* WordPress dependencies
[13639] Fix | Delete
*/
[13640] Fix | Delete
[13641] Fix | Delete
[13642] Fix | Delete
[13643] Fix | Delete
[13644] Fix | Delete
[13645] Fix | Delete
[13646] Fix | Delete
[13647] Fix | Delete
/**
[13648] Fix | Delete
* Internal dependencies
[13649] Fix | Delete
*/
[13650] Fix | Delete
[13651] Fix | Delete
[13652] Fix | Delete
[13653] Fix | Delete
[13654] Fix | Delete
function writeInterstitialMessage(targetDocument) {
[13655] Fix | Delete
let markup = (0,external_wp_element_namespaceObject.renderToString)( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[13656] Fix | Delete
className: "editor-post-preview-button__interstitial-message",
[13657] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, {
[13658] Fix | Delete
xmlns: "http://www.w3.org/2000/svg",
[13659] Fix | Delete
viewBox: "0 0 96 96",
[13660] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
[13661] Fix | Delete
className: "outer",
[13662] Fix | Delete
d: "M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",
[13663] Fix | Delete
fill: "none"
[13664] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, {
[13665] Fix | Delete
className: "inner",
[13666] Fix | Delete
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",
[13667] Fix | Delete
fill: "none"
[13668] Fix | Delete
})]
[13669] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[13670] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Generating preview…')
[13671] Fix | Delete
})]
[13672] Fix | Delete
}));
[13673] Fix | Delete
markup += `
[13674] Fix | Delete
<style>
[13675] Fix | Delete
body {
[13676] Fix | Delete
margin: 0;
[13677] Fix | Delete
}
[13678] Fix | Delete
.editor-post-preview-button__interstitial-message {
[13679] Fix | Delete
display: flex;
[13680] Fix | Delete
flex-direction: column;
[13681] Fix | Delete
align-items: center;
[13682] Fix | Delete
justify-content: center;
[13683] Fix | Delete
height: 100vh;
[13684] Fix | Delete
width: 100vw;
[13685] Fix | Delete
}
[13686] Fix | Delete
@-webkit-keyframes paint {
[13687] Fix | Delete
0% {
[13688] Fix | Delete
stroke-dashoffset: 0;
[13689] Fix | Delete
}
[13690] Fix | Delete
}
[13691] Fix | Delete
@-moz-keyframes paint {
[13692] Fix | Delete
0% {
[13693] Fix | Delete
stroke-dashoffset: 0;
[13694] Fix | Delete
}
[13695] Fix | Delete
}
[13696] Fix | Delete
@-o-keyframes paint {
[13697] Fix | Delete
0% {
[13698] Fix | Delete
stroke-dashoffset: 0;
[13699] Fix | Delete
}
[13700] Fix | Delete
}
[13701] Fix | Delete
@keyframes paint {
[13702] Fix | Delete
0% {
[13703] Fix | Delete
stroke-dashoffset: 0;
[13704] Fix | Delete
}
[13705] Fix | Delete
}
[13706] Fix | Delete
.editor-post-preview-button__interstitial-message svg {
[13707] Fix | Delete
width: 192px;
[13708] Fix | Delete
height: 192px;
[13709] Fix | Delete
stroke: #555d66;
[13710] Fix | Delete
stroke-width: 0.75;
[13711] Fix | Delete
}
[13712] Fix | Delete
.editor-post-preview-button__interstitial-message svg .outer,
[13713] Fix | Delete
.editor-post-preview-button__interstitial-message svg .inner {
[13714] Fix | Delete
stroke-dasharray: 280;
[13715] Fix | Delete
stroke-dashoffset: 280;
[13716] Fix | Delete
-webkit-animation: paint 1.5s ease infinite alternate;
[13717] Fix | Delete
-moz-animation: paint 1.5s ease infinite alternate;
[13718] Fix | Delete
-o-animation: paint 1.5s ease infinite alternate;
[13719] Fix | Delete
animation: paint 1.5s ease infinite alternate;
[13720] Fix | Delete
}
[13721] Fix | Delete
p {
[13722] Fix | Delete
text-align: center;
[13723] Fix | Delete
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
[13724] Fix | Delete
}
[13725] Fix | Delete
</style>
[13726] Fix | Delete
`;
[13727] Fix | Delete
[13728] Fix | Delete
/**
[13729] Fix | Delete
* Filters the interstitial message shown when generating previews.
[13730] Fix | Delete
*
[13731] Fix | Delete
* @param {string} markup The preview interstitial markup.
[13732] Fix | Delete
*/
[13733] Fix | Delete
markup = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostPreview.interstitialMarkup', markup);
[13734] Fix | Delete
targetDocument.write(markup);
[13735] Fix | Delete
targetDocument.title = (0,external_wp_i18n_namespaceObject.__)('Generating preview…');
[13736] Fix | Delete
targetDocument.close();
[13737] Fix | Delete
}
[13738] Fix | Delete
[13739] Fix | Delete
/**
[13740] Fix | Delete
* Renders a button that opens a new window or tab for the preview,
[13741] Fix | Delete
* writes the interstitial message to this window, and then navigates
[13742] Fix | Delete
* to the actual preview link. The button is not rendered if the post
[13743] Fix | Delete
* is not viewable and disabled if the post is not saveable.
[13744] Fix | Delete
*
[13745] Fix | Delete
* @param {Object} props The component props.
[13746] Fix | Delete
* @param {string} props.className The class name for the button.
[13747] Fix | Delete
* @param {string} props.textContent The text content for the button.
[13748] Fix | Delete
* @param {boolean} props.forceIsAutosaveable Whether to force autosave.
[13749] Fix | Delete
* @param {string} props.role The role attribute for the button.
[13750] Fix | Delete
* @param {Function} props.onPreview The callback function for preview event.
[13751] Fix | Delete
*
[13752] Fix | Delete
* @return {JSX.Element|null} The rendered button component.
[13753] Fix | Delete
*/
[13754] Fix | Delete
function PostPreviewButton({
[13755] Fix | Delete
className,
[13756] Fix | Delete
textContent,
[13757] Fix | Delete
forceIsAutosaveable,
[13758] Fix | Delete
role,
[13759] Fix | Delete
onPreview
[13760] Fix | Delete
}) {
[13761] Fix | Delete
const {
[13762] Fix | Delete
postId,
[13763] Fix | Delete
currentPostLink,
[13764] Fix | Delete
previewLink,
[13765] Fix | Delete
isSaveable,
[13766] Fix | Delete
isViewable
[13767] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[13768] Fix | Delete
var _postType$viewable;
[13769] Fix | Delete
const editor = select(store_store);
[13770] Fix | Delete
const core = select(external_wp_coreData_namespaceObject.store);
[13771] Fix | Delete
const postType = core.getPostType(editor.getCurrentPostType('type'));
[13772] Fix | Delete
return {
[13773] Fix | Delete
postId: editor.getCurrentPostId(),
[13774] Fix | Delete
currentPostLink: editor.getCurrentPostAttribute('link'),
[13775] Fix | Delete
previewLink: editor.getEditedPostPreviewLink(),
[13776] Fix | Delete
isSaveable: editor.isEditedPostSaveable(),
[13777] Fix | Delete
isViewable: (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false
[13778] Fix | Delete
};
[13779] Fix | Delete
}, []);
[13780] Fix | Delete
const {
[13781] Fix | Delete
__unstableSaveForPreview
[13782] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
[13783] Fix | Delete
if (!isViewable) {
[13784] Fix | Delete
return null;
[13785] Fix | Delete
}
[13786] Fix | Delete
const targetId = `wp-preview-${postId}`;
[13787] Fix | Delete
const openPreviewWindow = async event => {
[13788] Fix | Delete
// Our Preview button has its 'href' and 'target' set correctly for a11y
[13789] Fix | Delete
// purposes. Unfortunately, though, we can't rely on the default 'click'
[13790] Fix | Delete
// handler since sometimes it incorrectly opens a new tab instead of reusing
[13791] Fix | Delete
// the existing one.
[13792] Fix | Delete
// https://github.com/WordPress/gutenberg/pull/8330
[13793] Fix | Delete
event.preventDefault();
[13794] Fix | Delete
[13795] Fix | Delete
// Open up a Preview tab if needed. This is where we'll show the preview.
[13796] Fix | Delete
const previewWindow = window.open('', targetId);
[13797] Fix | Delete
[13798] Fix | Delete
// Focus the Preview tab. This might not do anything, depending on the browser's
[13799] Fix | Delete
// and user's preferences.
[13800] Fix | Delete
// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
[13801] Fix | Delete
previewWindow.focus();
[13802] Fix | Delete
writeInterstitialMessage(previewWindow.document);
[13803] Fix | Delete
const link = await __unstableSaveForPreview({
[13804] Fix | Delete
forceIsAutosaveable
[13805] Fix | Delete
});
[13806] Fix | Delete
previewWindow.location = link;
[13807] Fix | Delete
onPreview?.();
[13808] Fix | Delete
};
[13809] Fix | Delete
[13810] Fix | Delete
// Link to the `?preview=true` URL if we have it, since this lets us see
[13811] Fix | Delete
// changes that were autosaved since the post was last published. Otherwise,
[13812] Fix | Delete
// just link to the post's URL.
[13813] Fix | Delete
const href = previewLink || currentPostLink;
[13814] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[13815] Fix | Delete
variant: !className ? 'tertiary' : undefined,
[13816] Fix | Delete
className: className || 'editor-post-preview',
[13817] Fix | Delete
href: href,
[13818] Fix | Delete
target: targetId,
[13819] Fix | Delete
__experimentalIsFocusable: true,
[13820] Fix | Delete
disabled: !isSaveable,
[13821] Fix | Delete
onClick: openPreviewWindow,
[13822] Fix | Delete
role: role,
[13823] Fix | Delete
size: "compact",
[13824] Fix | Delete
children: textContent || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[13825] Fix | Delete
children: [(0,external_wp_i18n_namespaceObject._x)('Preview', 'imperative verb'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
[13826] Fix | Delete
as: "span",
[13827] Fix | Delete
children: /* translators: accessibility text */
[13828] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')
[13829] Fix | Delete
})]
[13830] Fix | Delete
})
[13831] Fix | Delete
});
[13832] Fix | Delete
}
[13833] Fix | Delete
[13834] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-button/label.js
[13835] Fix | Delete
/**
[13836] Fix | Delete
* WordPress dependencies
[13837] Fix | Delete
*/
[13838] Fix | Delete
[13839] Fix | Delete
[13840] Fix | Delete
[13841] Fix | Delete
[13842] Fix | Delete
/**
[13843] Fix | Delete
* Internal dependencies
[13844] Fix | Delete
*/
[13845] Fix | Delete
[13846] Fix | Delete
function PublishButtonLabel() {
[13847] Fix | Delete
const isSmallerThanMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
[13848] Fix | Delete
const {
[13849] Fix | Delete
isPublished,
[13850] Fix | Delete
isBeingScheduled,
[13851] Fix | Delete
isSaving,
[13852] Fix | Delete
isPublishing,
[13853] Fix | Delete
hasPublishAction,
[13854] Fix | Delete
isAutosaving,
[13855] Fix | Delete
hasNonPostEntityChanges,
[13856] Fix | Delete
postStatusHasChanged,
[13857] Fix | Delete
postStatus
[13858] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[13859] Fix | Delete
var _getCurrentPost$_link;
[13860] Fix | Delete
const {
[13861] Fix | Delete
isCurrentPostPublished,
[13862] Fix | Delete
isEditedPostBeingScheduled,
[13863] Fix | Delete
isSavingPost,
[13864] Fix | Delete
isPublishingPost,
[13865] Fix | Delete
getCurrentPost,
[13866] Fix | Delete
getCurrentPostType,
[13867] Fix | Delete
isAutosavingPost,
[13868] Fix | Delete
getPostEdits,
[13869] Fix | Delete
getEditedPostAttribute
[13870] Fix | Delete
} = select(store_store);
[13871] Fix | Delete
return {
[13872] Fix | Delete
isPublished: isCurrentPostPublished(),
[13873] Fix | Delete
isBeingScheduled: isEditedPostBeingScheduled(),
[13874] Fix | Delete
isSaving: isSavingPost(),
[13875] Fix | Delete
isPublishing: isPublishingPost(),
[13876] Fix | Delete
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
[13877] Fix | Delete
postType: getCurrentPostType(),
[13878] Fix | Delete
isAutosaving: isAutosavingPost(),
[13879] Fix | Delete
hasNonPostEntityChanges: select(store_store).hasNonPostEntityChanges(),
[13880] Fix | Delete
postStatusHasChanged: !!getPostEdits()?.status,
[13881] Fix | Delete
postStatus: getEditedPostAttribute('status')
[13882] Fix | Delete
};
[13883] Fix | Delete
}, []);
[13884] Fix | Delete
if (isPublishing) {
[13885] Fix | Delete
/* translators: button label text should, if possible, be under 16 characters. */
[13886] Fix | Delete
return (0,external_wp_i18n_namespaceObject.__)('Publishing…');
[13887] Fix | Delete
} else if ((isPublished || isBeingScheduled) && isSaving && !isAutosaving) {
[13888] Fix | Delete
/* translators: button label text should, if possible, be under 16 characters. */
[13889] Fix | Delete
return (0,external_wp_i18n_namespaceObject.__)('Saving…');
[13890] Fix | Delete
}
[13891] Fix | Delete
if (!hasPublishAction) {
[13892] Fix | Delete
// TODO: this is because "Submit for review" string is too long in some languages.
[13893] Fix | Delete
// @see https://github.com/WordPress/gutenberg/issues/10475
[13894] Fix | Delete
return isSmallerThanMediumViewport ? (0,external_wp_i18n_namespaceObject.__)('Publish') : (0,external_wp_i18n_namespaceObject.__)('Submit for Review');
[13895] Fix | Delete
}
[13896] Fix | Delete
if (hasNonPostEntityChanges || isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || !postStatusHasChanged && postStatus === 'future') {
[13897] Fix | Delete
return (0,external_wp_i18n_namespaceObject.__)('Save');
[13898] Fix | Delete
}
[13899] Fix | Delete
if (isBeingScheduled) {
[13900] Fix | Delete
return (0,external_wp_i18n_namespaceObject.__)('Schedule');
[13901] Fix | Delete
}
[13902] Fix | Delete
return (0,external_wp_i18n_namespaceObject.__)('Publish');
[13903] Fix | Delete
}
[13904] Fix | Delete
[13905] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-publish-button/index.js
[13906] Fix | Delete
/**
[13907] Fix | Delete
* WordPress dependencies
[13908] Fix | Delete
*/
[13909] Fix | Delete
[13910] Fix | Delete
[13911] Fix | Delete
[13912] Fix | Delete
[13913] Fix | Delete
[13914] Fix | Delete
/**
[13915] Fix | Delete
* Internal dependencies
[13916] Fix | Delete
*/
[13917] Fix | Delete
[13918] Fix | Delete
[13919] Fix | Delete
[13920] Fix | Delete
[13921] Fix | Delete
const post_publish_button_noop = () => {};
[13922] Fix | Delete
class PostPublishButton extends external_wp_element_namespaceObject.Component {
[13923] Fix | Delete
constructor(props) {
[13924] Fix | Delete
super(props);
[13925] Fix | Delete
this.buttonNode = (0,external_wp_element_namespaceObject.createRef)();
[13926] Fix | Delete
this.createOnClick = this.createOnClick.bind(this);
[13927] Fix | Delete
this.closeEntitiesSavedStates = this.closeEntitiesSavedStates.bind(this);
[13928] Fix | Delete
this.state = {
[13929] Fix | Delete
entitiesSavedStatesCallback: false
[13930] Fix | Delete
};
[13931] Fix | Delete
}
[13932] Fix | Delete
componentDidMount() {
[13933] Fix | Delete
if (this.props.focusOnMount) {
[13934] Fix | Delete
// This timeout is necessary to make sure the `useEffect` hook of
[13935] Fix | Delete
// `useFocusReturn` gets the correct element (the button that opens the
[13936] Fix | Delete
// PostPublishPanel) otherwise it will get this button.
[13937] Fix | Delete
this.timeoutID = setTimeout(() => {
[13938] Fix | Delete
this.buttonNode.current.focus();
[13939] Fix | Delete
}, 0);
[13940] Fix | Delete
}
[13941] Fix | Delete
}
[13942] Fix | Delete
componentWillUnmount() {
[13943] Fix | Delete
clearTimeout(this.timeoutID);
[13944] Fix | Delete
}
[13945] Fix | Delete
createOnClick(callback) {
[13946] Fix | Delete
return (...args) => {
[13947] Fix | Delete
const {
[13948] Fix | Delete
hasNonPostEntityChanges,
[13949] Fix | Delete
setEntitiesSavedStatesCallback
[13950] Fix | Delete
} = this.props;
[13951] Fix | Delete
// If a post with non-post entities is published, but the user
[13952] Fix | Delete
// elects to not save changes to the non-post entities, those
[13953] Fix | Delete
// entities will still be dirty when the Publish button is clicked.
[13954] Fix | Delete
// We also need to check that the `setEntitiesSavedStatesCallback`
[13955] Fix | Delete
// prop was passed. See https://github.com/WordPress/gutenberg/pull/37383
[13956] Fix | Delete
if (hasNonPostEntityChanges && setEntitiesSavedStatesCallback) {
[13957] Fix | Delete
// The modal for multiple entity saving will open,
[13958] Fix | Delete
// hold the callback for saving/publishing the post
[13959] Fix | Delete
// so that we can call it if the post entity is checked.
[13960] Fix | Delete
this.setState({
[13961] Fix | Delete
entitiesSavedStatesCallback: () => callback(...args)
[13962] Fix | Delete
});
[13963] Fix | Delete
[13964] Fix | Delete
// Open the save panel by setting its callback.
[13965] Fix | Delete
// To set a function on the useState hook, we must set it
[13966] Fix | Delete
// with another function (() => myFunction). Passing the
[13967] Fix | Delete
// function on its own will cause an error when called.
[13968] Fix | Delete
setEntitiesSavedStatesCallback(() => this.closeEntitiesSavedStates);
[13969] Fix | Delete
return post_publish_button_noop;
[13970] Fix | Delete
}
[13971] Fix | Delete
return callback(...args);
[13972] Fix | Delete
};
[13973] Fix | Delete
}
[13974] Fix | Delete
closeEntitiesSavedStates(savedEntities) {
[13975] Fix | Delete
const {
[13976] Fix | Delete
postType,
[13977] Fix | Delete
postId
[13978] Fix | Delete
} = this.props;
[13979] Fix | Delete
const {
[13980] Fix | Delete
entitiesSavedStatesCallback
[13981] Fix | Delete
} = this.state;
[13982] Fix | Delete
this.setState({
[13983] Fix | Delete
entitiesSavedStatesCallback: false
[13984] Fix | Delete
}, () => {
[13985] Fix | Delete
if (savedEntities && savedEntities.some(elt => elt.kind === 'postType' && elt.name === postType && elt.key === postId)) {
[13986] Fix | Delete
// The post entity was checked, call the held callback from `createOnClick`.
[13987] Fix | Delete
entitiesSavedStatesCallback();
[13988] Fix | Delete
}
[13989] Fix | Delete
});
[13990] Fix | Delete
}
[13991] Fix | Delete
render() {
[13992] Fix | Delete
const {
[13993] Fix | Delete
forceIsDirty,
[13994] Fix | Delete
hasPublishAction,
[13995] Fix | Delete
isBeingScheduled,
[13996] Fix | Delete
isOpen,
[13997] Fix | Delete
isPostSavingLocked,
[13998] Fix | Delete
isPublishable,
[13999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function