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
const shouldUseDescriptionLabel = ['wp_template', 'wp_template_part', 'wp_block'].includes(postType);
[12500] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
[12501] Fix | Delete
title: shouldUseDescriptionLabel ? (0,external_wp_i18n_namespaceObject.__)('Description') : (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
[12502] Fix | Delete
opened: isOpened,
[12503] Fix | Delete
onToggle: toggleExcerptPanel,
[12504] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_plugin.Slot, {
[12505] Fix | Delete
children: fills => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[12506] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostExcerpt, {}), fills]
[12507] Fix | Delete
})
[12508] Fix | Delete
})
[12509] Fix | Delete
});
[12510] Fix | Delete
}
[12511] Fix | Delete
[12512] Fix | Delete
/**
[12513] Fix | Delete
* Is rendered if the post type supports excerpts and allows editing the excerpt.
[12514] Fix | Delete
*
[12515] Fix | Delete
* @return {JSX.Element} The rendered PostExcerptPanel component.
[12516] Fix | Delete
*/
[12517] Fix | Delete
function PostExcerptPanel() {
[12518] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, {
[12519] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExcerptPanel, {})
[12520] Fix | Delete
});
[12521] Fix | Delete
}
[12522] Fix | Delete
function PrivatePostExcerptPanel() {
[12523] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_check, {
[12524] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateExcerpt, {})
[12525] Fix | Delete
});
[12526] Fix | Delete
}
[12527] Fix | Delete
function PrivateExcerpt() {
[12528] Fix | Delete
const {
[12529] Fix | Delete
shouldRender,
[12530] Fix | Delete
excerpt,
[12531] Fix | Delete
shouldBeUsedAsDescription,
[12532] Fix | Delete
allowEditing
[12533] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[12534] Fix | Delete
const {
[12535] Fix | Delete
getCurrentPostType,
[12536] Fix | Delete
getCurrentPostId,
[12537] Fix | Delete
getEditedPostAttribute,
[12538] Fix | Delete
isEditorPanelEnabled
[12539] Fix | Delete
} = select(store_store);
[12540] Fix | Delete
const postType = getCurrentPostType();
[12541] Fix | Delete
const isTemplateOrTemplatePart = ['wp_template', 'wp_template_part'].includes(postType);
[12542] Fix | Delete
const isPattern = postType === 'wp_block';
[12543] Fix | Delete
// These post types use the `excerpt` field as a description semantically, so we need to
[12544] Fix | Delete
// handle proper labeling and some flows where we should always render them as text.
[12545] Fix | Delete
const _shouldBeUsedAsDescription = isTemplateOrTemplatePart || isPattern;
[12546] Fix | Delete
const _usedAttribute = isTemplateOrTemplatePart ? 'description' : 'excerpt';
[12547] Fix | Delete
// We need to fetch the entity in this case to check if we'll allow editing.
[12548] Fix | Delete
const template = isTemplateOrTemplatePart && select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, getCurrentPostId());
[12549] Fix | Delete
// For post types that use excerpt as description, we do not abide
[12550] Fix | Delete
// by the `isEnabled` panel flag in order to render them as text.
[12551] Fix | Delete
const _shouldRender = isEditorPanelEnabled(post_excerpt_panel_PANEL_NAME) || _shouldBeUsedAsDescription;
[12552] Fix | Delete
return {
[12553] Fix | Delete
excerpt: getEditedPostAttribute(_usedAttribute),
[12554] Fix | Delete
shouldRender: _shouldRender,
[12555] Fix | Delete
shouldBeUsedAsDescription: _shouldBeUsedAsDescription,
[12556] Fix | Delete
// If we should render, allow editing for all post types that are not used as description.
[12557] Fix | Delete
// For the rest allow editing only for user generated entities.
[12558] Fix | Delete
allowEditing: _shouldRender && (!_shouldBeUsedAsDescription || isPattern || template && template.source === TEMPLATE_ORIGINS.custom && !template.has_theme_file)
[12559] Fix | Delete
};
[12560] Fix | Delete
}, []);
[12561] Fix | Delete
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
[12562] Fix | Delete
const label = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)('Description') : (0,external_wp_i18n_namespaceObject.__)('Excerpt');
[12563] Fix | Delete
// Memoize popoverProps to avoid returning a new object every time.
[12564] Fix | Delete
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
[12565] Fix | Delete
// Anchor the popover to the middle of the entire row so that it doesn't
[12566] Fix | Delete
// move around when the label changes.
[12567] Fix | Delete
anchor: popoverAnchor,
[12568] Fix | Delete
'aria-label': label,
[12569] Fix | Delete
headerTitle: label,
[12570] Fix | Delete
placement: 'left-start',
[12571] Fix | Delete
offset: 36,
[12572] Fix | Delete
shift: true
[12573] Fix | Delete
}), [popoverAnchor, label]);
[12574] Fix | Delete
if (!shouldRender) {
[12575] Fix | Delete
return false;
[12576] Fix | Delete
}
[12577] Fix | Delete
const excerptText = !!excerpt && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
[12578] Fix | Delete
align: "left",
[12579] Fix | Delete
numberOfLines: 4,
[12580] Fix | Delete
truncate: true,
[12581] Fix | Delete
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(excerpt)
[12582] Fix | Delete
});
[12583] Fix | Delete
if (!allowEditing) {
[12584] Fix | Delete
return excerptText;
[12585] Fix | Delete
}
[12586] Fix | Delete
const excerptPlaceholder = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)('Add a description…') : (0,external_wp_i18n_namespaceObject.__)('Add an excerpt…');
[12587] Fix | Delete
const triggerEditLabel = shouldBeUsedAsDescription ? (0,external_wp_i18n_namespaceObject.__)('Edit description') : (0,external_wp_i18n_namespaceObject.__)('Edit excerpt');
[12588] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
[12589] Fix | Delete
children: [excerptText, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
[12590] Fix | Delete
className: "editor-post-excerpt__dropdown",
[12591] Fix | Delete
contentClassName: "editor-post-excerpt__dropdown__content",
[12592] Fix | Delete
popoverProps: popoverProps,
[12593] Fix | Delete
focusOnMount: true,
[12594] Fix | Delete
ref: setPopoverAnchor,
[12595] Fix | Delete
renderToggle: ({
[12596] Fix | Delete
onToggle
[12597] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[12598] Fix | Delete
className: "editor-post-excerpt__dropdown__trigger",
[12599] Fix | Delete
onClick: onToggle,
[12600] Fix | Delete
variant: "link",
[12601] Fix | Delete
children: excerptText ? triggerEditLabel : excerptPlaceholder
[12602] Fix | Delete
}),
[12603] Fix | Delete
renderContent: ({
[12604] Fix | Delete
onClose
[12605] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[12606] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
[12607] Fix | Delete
title: label,
[12608] Fix | Delete
onClose: onClose
[12609] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, {
[12610] Fix | Delete
spacing: 4,
[12611] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_excerpt_plugin.Slot, {
[12612] Fix | Delete
children: fills => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
[12613] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostExcerpt, {
[12614] Fix | Delete
hideLabelFromVision: true,
[12615] Fix | Delete
updateOnBlur: true
[12616] Fix | Delete
}), fills]
[12617] Fix | Delete
})
[12618] Fix | Delete
})
[12619] Fix | Delete
})]
[12620] Fix | Delete
})
[12621] Fix | Delete
})]
[12622] Fix | Delete
});
[12623] Fix | Delete
}
[12624] Fix | Delete
[12625] Fix | Delete
;// CONCATENATED MODULE: external ["wp","blob"]
[12626] Fix | Delete
const external_wp_blob_namespaceObject = window["wp"]["blob"];
[12627] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/theme-support-check/index.js
[12628] Fix | Delete
/**
[12629] Fix | Delete
* WordPress dependencies
[12630] Fix | Delete
*/
[12631] Fix | Delete
[12632] Fix | Delete
[12633] Fix | Delete
[12634] Fix | Delete
/**
[12635] Fix | Delete
* Internal dependencies
[12636] Fix | Delete
*/
[12637] Fix | Delete
[12638] Fix | Delete
function ThemeSupportCheck({
[12639] Fix | Delete
children,
[12640] Fix | Delete
supportKeys
[12641] Fix | Delete
}) {
[12642] Fix | Delete
const {
[12643] Fix | Delete
postType,
[12644] Fix | Delete
themeSupports
[12645] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[12646] Fix | Delete
return {
[12647] Fix | Delete
postType: select(store_store).getEditedPostAttribute('type'),
[12648] Fix | Delete
themeSupports: select(external_wp_coreData_namespaceObject.store).getThemeSupports()
[12649] Fix | Delete
};
[12650] Fix | Delete
}, []);
[12651] Fix | Delete
const isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some(key => {
[12652] Fix | Delete
var _themeSupports$key;
[12653] Fix | Delete
const supported = (_themeSupports$key = themeSupports?.[key]) !== null && _themeSupports$key !== void 0 ? _themeSupports$key : false;
[12654] Fix | Delete
// 'post-thumbnails' can be boolean or an array of post types.
[12655] Fix | Delete
// In the latter case, we need to verify `postType` exists
[12656] Fix | Delete
// within `supported`. If `postType` isn't passed, then the check
[12657] Fix | Delete
// should fail.
[12658] Fix | Delete
if ('post-thumbnails' === key && Array.isArray(supported)) {
[12659] Fix | Delete
return supported.includes(postType);
[12660] Fix | Delete
}
[12661] Fix | Delete
return supported;
[12662] Fix | Delete
});
[12663] Fix | Delete
if (!isSupported) {
[12664] Fix | Delete
return null;
[12665] Fix | Delete
}
[12666] Fix | Delete
return children;
[12667] Fix | Delete
}
[12668] Fix | Delete
[12669] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/check.js
[12670] Fix | Delete
/**
[12671] Fix | Delete
* Internal dependencies
[12672] Fix | Delete
*/
[12673] Fix | Delete
[12674] Fix | Delete
[12675] Fix | Delete
[12676] Fix | Delete
/**
[12677] Fix | Delete
* Wrapper component that renders its children only if the post type supports a featured image
[12678] Fix | Delete
* and the theme supports post thumbnails.
[12679] Fix | Delete
*
[12680] Fix | Delete
* @param {Object} props Props.
[12681] Fix | Delete
* @param {Element} props.children Children to be rendered.
[12682] Fix | Delete
*
[12683] Fix | Delete
* @return {Component} The component to be rendered.
[12684] Fix | Delete
*/
[12685] Fix | Delete
[12686] Fix | Delete
function PostFeaturedImageCheck({
[12687] Fix | Delete
children
[12688] Fix | Delete
}) {
[12689] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ThemeSupportCheck, {
[12690] Fix | Delete
supportKeys: "post-thumbnails",
[12691] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_type_support_check, {
[12692] Fix | Delete
supportKeys: "thumbnail",
[12693] Fix | Delete
children: children
[12694] Fix | Delete
})
[12695] Fix | Delete
});
[12696] Fix | Delete
}
[12697] Fix | Delete
/* harmony default export */ const post_featured_image_check = (PostFeaturedImageCheck);
[12698] Fix | Delete
[12699] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/index.js
[12700] Fix | Delete
/**
[12701] Fix | Delete
* WordPress dependencies
[12702] Fix | Delete
*/
[12703] Fix | Delete
[12704] Fix | Delete
[12705] Fix | Delete
[12706] Fix | Delete
[12707] Fix | Delete
[12708] Fix | Delete
[12709] Fix | Delete
[12710] Fix | Delete
[12711] Fix | Delete
[12712] Fix | Delete
[12713] Fix | Delete
/**
[12714] Fix | Delete
* Internal dependencies
[12715] Fix | Delete
*/
[12716] Fix | Delete
[12717] Fix | Delete
[12718] Fix | Delete
[12719] Fix | Delete
[12720] Fix | Delete
const ALLOWED_MEDIA_TYPES = ['image'];
[12721] Fix | Delete
[12722] Fix | Delete
// Used when labels from post type were not yet loaded or when they are not present.
[12723] Fix | Delete
const DEFAULT_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)('Featured image');
[12724] Fix | Delete
const DEFAULT_SET_FEATURE_IMAGE_LABEL = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
[12725] Fix | Delete
const instructions = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
[12726] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('To edit the featured image, you need permission to upload media.')
[12727] Fix | Delete
});
[12728] Fix | Delete
function getMediaDetails(media, postId) {
[12729] Fix | Delete
var _media$media_details$, _media$media_details$2;
[12730] Fix | Delete
if (!media) {
[12731] Fix | Delete
return {};
[12732] Fix | Delete
}
[12733] Fix | Delete
const defaultSize = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostFeaturedImage.imageSize', 'large', media.id, postId);
[12734] Fix | Delete
if (defaultSize in ((_media$media_details$ = media?.media_details?.sizes) !== null && _media$media_details$ !== void 0 ? _media$media_details$ : {})) {
[12735] Fix | Delete
return {
[12736] Fix | Delete
mediaWidth: media.media_details.sizes[defaultSize].width,
[12737] Fix | Delete
mediaHeight: media.media_details.sizes[defaultSize].height,
[12738] Fix | Delete
mediaSourceUrl: media.media_details.sizes[defaultSize].source_url
[12739] Fix | Delete
};
[12740] Fix | Delete
}
[12741] Fix | Delete
[12742] Fix | Delete
// Use fallbackSize when defaultSize is not available.
[12743] Fix | Delete
const fallbackSize = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.PostFeaturedImage.imageSize', 'thumbnail', media.id, postId);
[12744] Fix | Delete
if (fallbackSize in ((_media$media_details$2 = media?.media_details?.sizes) !== null && _media$media_details$2 !== void 0 ? _media$media_details$2 : {})) {
[12745] Fix | Delete
return {
[12746] Fix | Delete
mediaWidth: media.media_details.sizes[fallbackSize].width,
[12747] Fix | Delete
mediaHeight: media.media_details.sizes[fallbackSize].height,
[12748] Fix | Delete
mediaSourceUrl: media.media_details.sizes[fallbackSize].source_url
[12749] Fix | Delete
};
[12750] Fix | Delete
}
[12751] Fix | Delete
[12752] Fix | Delete
// Use full image size when fallbackSize and defaultSize are not available.
[12753] Fix | Delete
return {
[12754] Fix | Delete
mediaWidth: media.media_details.width,
[12755] Fix | Delete
mediaHeight: media.media_details.height,
[12756] Fix | Delete
mediaSourceUrl: media.source_url
[12757] Fix | Delete
};
[12758] Fix | Delete
}
[12759] Fix | Delete
function PostFeaturedImage({
[12760] Fix | Delete
currentPostId,
[12761] Fix | Delete
featuredImageId,
[12762] Fix | Delete
onUpdateImage,
[12763] Fix | Delete
onRemoveImage,
[12764] Fix | Delete
media,
[12765] Fix | Delete
postType,
[12766] Fix | Delete
noticeUI,
[12767] Fix | Delete
noticeOperations
[12768] Fix | Delete
}) {
[12769] Fix | Delete
const toggleRef = (0,external_wp_element_namespaceObject.useRef)();
[12770] Fix | Delete
const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false);
[12771] Fix | Delete
const {
[12772] Fix | Delete
getSettings
[12773] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
[12774] Fix | Delete
const {
[12775] Fix | Delete
mediaSourceUrl
[12776] Fix | Delete
} = getMediaDetails(media, currentPostId);
[12777] Fix | Delete
function onDropFiles(filesList) {
[12778] Fix | Delete
getSettings().mediaUpload({
[12779] Fix | Delete
allowedTypes: ALLOWED_MEDIA_TYPES,
[12780] Fix | Delete
filesList,
[12781] Fix | Delete
onFileChange([image]) {
[12782] Fix | Delete
if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) {
[12783] Fix | Delete
setIsLoading(true);
[12784] Fix | Delete
return;
[12785] Fix | Delete
}
[12786] Fix | Delete
if (image) {
[12787] Fix | Delete
onUpdateImage(image);
[12788] Fix | Delete
}
[12789] Fix | Delete
setIsLoading(false);
[12790] Fix | Delete
},
[12791] Fix | Delete
onError(message) {
[12792] Fix | Delete
noticeOperations.removeAllNotices();
[12793] Fix | Delete
noticeOperations.createErrorNotice(message);
[12794] Fix | Delete
}
[12795] Fix | Delete
});
[12796] Fix | Delete
}
[12797] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(post_featured_image_check, {
[12798] Fix | Delete
children: [noticeUI, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[12799] Fix | Delete
className: "editor-post-featured-image",
[12800] Fix | Delete
children: [media && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[12801] Fix | Delete
id: `editor-post-featured-image-${featuredImageId}-describedby`,
[12802] Fix | Delete
className: "hidden",
[12803] Fix | Delete
children: [media.alt_text && (0,external_wp_i18n_namespaceObject.sprintf)(
[12804] Fix | Delete
// Translators: %s: The selected image alt text.
[12805] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('Current image: %s'), media.alt_text), !media.alt_text && (0,external_wp_i18n_namespaceObject.sprintf)(
[12806] Fix | Delete
// Translators: %s: The selected image filename.
[12807] Fix | Delete
(0,external_wp_i18n_namespaceObject.__)('The current image has no alternative text. The file name is: %s'), media.media_details.sizes?.full?.file || media.slug)]
[12808] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, {
[12809] Fix | Delete
fallback: instructions,
[12810] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaUpload, {
[12811] Fix | Delete
title: postType?.labels?.featured_image || DEFAULT_FEATURE_IMAGE_LABEL,
[12812] Fix | Delete
onSelect: onUpdateImage,
[12813] Fix | Delete
unstableFeaturedImageFlow: true,
[12814] Fix | Delete
allowedTypes: ALLOWED_MEDIA_TYPES,
[12815] Fix | Delete
modalClass: "editor-post-featured-image__media-modal",
[12816] Fix | Delete
render: ({
[12817] Fix | Delete
open
[12818] Fix | Delete
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
[12819] Fix | Delete
className: "editor-post-featured-image__container",
[12820] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, {
[12821] Fix | Delete
ref: toggleRef,
[12822] Fix | Delete
className: !featuredImageId ? 'editor-post-featured-image__toggle' : 'editor-post-featured-image__preview',
[12823] Fix | Delete
onClick: open,
[12824] Fix | Delete
"aria-label": !featuredImageId ? null : (0,external_wp_i18n_namespaceObject.__)('Edit or replace the image'),
[12825] Fix | Delete
"aria-describedby": !featuredImageId ? null : `editor-post-featured-image-${featuredImageId}-describedby`,
[12826] Fix | Delete
children: [!!featuredImageId && media && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
[12827] Fix | Delete
className: "editor-post-featured-image__preview-image",
[12828] Fix | Delete
src: mediaSourceUrl,
[12829] Fix | Delete
alt: ""
[12830] Fix | Delete
}), isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !featuredImageId && !isLoading && (postType?.labels?.set_featured_image || DEFAULT_SET_FEATURE_IMAGE_LABEL)]
[12831] Fix | Delete
}), !!featuredImageId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
[12832] Fix | Delete
className: "editor-post-featured-image__actions",
[12833] Fix | Delete
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[12834] Fix | Delete
className: "editor-post-featured-image__action",
[12835] Fix | Delete
onClick: open,
[12836] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Replace')
[12837] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
[12838] Fix | Delete
className: "editor-post-featured-image__action",
[12839] Fix | Delete
onClick: () => {
[12840] Fix | Delete
onRemoveImage();
[12841] Fix | Delete
toggleRef.current.focus();
[12842] Fix | Delete
},
[12843] Fix | Delete
children: (0,external_wp_i18n_namespaceObject.__)('Remove')
[12844] Fix | Delete
})]
[12845] Fix | Delete
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, {
[12846] Fix | Delete
onFilesDrop: onDropFiles
[12847] Fix | Delete
})]
[12848] Fix | Delete
}),
[12849] Fix | Delete
value: featuredImageId
[12850] Fix | Delete
})
[12851] Fix | Delete
})]
[12852] Fix | Delete
})]
[12853] Fix | Delete
});
[12854] Fix | Delete
}
[12855] Fix | Delete
const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)(select => {
[12856] Fix | Delete
const {
[12857] Fix | Delete
getMedia,
[12858] Fix | Delete
getPostType
[12859] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[12860] Fix | Delete
const {
[12861] Fix | Delete
getCurrentPostId,
[12862] Fix | Delete
getEditedPostAttribute
[12863] Fix | Delete
} = select(store_store);
[12864] Fix | Delete
const featuredImageId = getEditedPostAttribute('featured_media');
[12865] Fix | Delete
return {
[12866] Fix | Delete
media: featuredImageId ? getMedia(featuredImageId, {
[12867] Fix | Delete
context: 'view'
[12868] Fix | Delete
}) : null,
[12869] Fix | Delete
currentPostId: getCurrentPostId(),
[12870] Fix | Delete
postType: getPostType(getEditedPostAttribute('type')),
[12871] Fix | Delete
featuredImageId
[12872] Fix | Delete
};
[12873] Fix | Delete
});
[12874] Fix | Delete
const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, {
[12875] Fix | Delete
noticeOperations
[12876] Fix | Delete
}, {
[12877] Fix | Delete
select
[12878] Fix | Delete
}) => {
[12879] Fix | Delete
const {
[12880] Fix | Delete
editPost
[12881] Fix | Delete
} = dispatch(store_store);
[12882] Fix | Delete
return {
[12883] Fix | Delete
onUpdateImage(image) {
[12884] Fix | Delete
editPost({
[12885] Fix | Delete
featured_media: image.id
[12886] Fix | Delete
});
[12887] Fix | Delete
},
[12888] Fix | Delete
onDropImage(filesList) {
[12889] Fix | Delete
select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload({
[12890] Fix | Delete
allowedTypes: ['image'],
[12891] Fix | Delete
filesList,
[12892] Fix | Delete
onFileChange([image]) {
[12893] Fix | Delete
editPost({
[12894] Fix | Delete
featured_media: image.id
[12895] Fix | Delete
});
[12896] Fix | Delete
},
[12897] Fix | Delete
onError(message) {
[12898] Fix | Delete
noticeOperations.removeAllNotices();
[12899] Fix | Delete
noticeOperations.createErrorNotice(message);
[12900] Fix | Delete
}
[12901] Fix | Delete
});
[12902] Fix | Delete
},
[12903] Fix | Delete
onRemoveImage() {
[12904] Fix | Delete
editPost({
[12905] Fix | Delete
featured_media: 0
[12906] Fix | Delete
});
[12907] Fix | Delete
}
[12908] Fix | Delete
};
[12909] Fix | Delete
});
[12910] Fix | Delete
[12911] Fix | Delete
/**
[12912] Fix | Delete
* Renders the component for managing the featured image of a post.
[12913] Fix | Delete
*
[12914] Fix | Delete
* @param {Object} props Props.
[12915] Fix | Delete
* @param {number} props.currentPostId ID of the current post.
[12916] Fix | Delete
* @param {number} props.featuredImageId ID of the featured image.
[12917] Fix | Delete
* @param {Function} props.onUpdateImage Function to call when the image is updated.
[12918] Fix | Delete
* @param {Function} props.onRemoveImage Function to call when the image is removed.
[12919] Fix | Delete
* @param {Object} props.media The media object representing the featured image.
[12920] Fix | Delete
* @param {string} props.postType Post type.
[12921] Fix | Delete
* @param {Element} props.noticeUI UI for displaying notices.
[12922] Fix | Delete
* @param {Object} props.noticeOperations Operations for managing notices.
[12923] Fix | Delete
*
[12924] Fix | Delete
* @return {Element} Component to be rendered .
[12925] Fix | Delete
*/
[12926] Fix | Delete
/* harmony default export */ const post_featured_image = ((0,external_wp_compose_namespaceObject.compose)(external_wp_components_namespaceObject.withNotices, applyWithSelect, applyWithDispatch, (0,external_wp_components_namespaceObject.withFilters)('editor.PostFeaturedImage'))(PostFeaturedImage));
[12927] Fix | Delete
[12928] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-featured-image/panel.js
[12929] Fix | Delete
/**
[12930] Fix | Delete
* WordPress dependencies
[12931] Fix | Delete
*/
[12932] Fix | Delete
[12933] Fix | Delete
[12934] Fix | Delete
[12935] Fix | Delete
[12936] Fix | Delete
[12937] Fix | Delete
/**
[12938] Fix | Delete
* Internal dependencies
[12939] Fix | Delete
*/
[12940] Fix | Delete
[12941] Fix | Delete
[12942] Fix | Delete
[12943] Fix | Delete
[12944] Fix | Delete
const post_featured_image_panel_PANEL_NAME = 'featured-image';
[12945] Fix | Delete
[12946] Fix | Delete
/**
[12947] Fix | Delete
* Renders the panel for the post featured image.
[12948] Fix | Delete
*
[12949] Fix | Delete
* @param {Object} props Props.
[12950] Fix | Delete
* @param {boolean} props.withPanelBody Whether to include the panel body. Default true.
[12951] Fix | Delete
*
[12952] Fix | Delete
* @return {Component|null} The component to be rendered.
[12953] Fix | Delete
* Return Null if the editor panel is disabled for featured image.
[12954] Fix | Delete
*/
[12955] Fix | Delete
function PostFeaturedImagePanel({
[12956] Fix | Delete
withPanelBody = true
[12957] Fix | Delete
}) {
[12958] Fix | Delete
var _postType$labels$feat;
[12959] Fix | Delete
const {
[12960] Fix | Delete
postType,
[12961] Fix | Delete
isEnabled,
[12962] Fix | Delete
isOpened
[12963] Fix | Delete
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
[12964] Fix | Delete
const {
[12965] Fix | Delete
getEditedPostAttribute,
[12966] Fix | Delete
isEditorPanelEnabled,
[12967] Fix | Delete
isEditorPanelOpened
[12968] Fix | Delete
} = select(store_store);
[12969] Fix | Delete
const {
[12970] Fix | Delete
getPostType
[12971] Fix | Delete
} = select(external_wp_coreData_namespaceObject.store);
[12972] Fix | Delete
return {
[12973] Fix | Delete
postType: getPostType(getEditedPostAttribute('type')),
[12974] Fix | Delete
isEnabled: isEditorPanelEnabled(post_featured_image_panel_PANEL_NAME),
[12975] Fix | Delete
isOpened: isEditorPanelOpened(post_featured_image_panel_PANEL_NAME)
[12976] Fix | Delete
};
[12977] Fix | Delete
}, []);
[12978] Fix | Delete
const {
[12979] Fix | Delete
toggleEditorPanelOpened
[12980] Fix | Delete
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
[12981] Fix | Delete
if (!isEnabled) {
[12982] Fix | Delete
return null;
[12983] Fix | Delete
}
[12984] Fix | Delete
if (!withPanelBody) {
[12985] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check, {
[12986] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image, {})
[12987] Fix | Delete
});
[12988] Fix | Delete
}
[12989] Fix | Delete
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_check, {
[12990] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, {
[12991] Fix | Delete
title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : (0,external_wp_i18n_namespaceObject.__)('Featured image'),
[12992] Fix | Delete
opened: isOpened,
[12993] Fix | Delete
onToggle: () => toggleEditorPanelOpened(post_featured_image_panel_PANEL_NAME),
[12994] Fix | Delete
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image, {})
[12995] Fix | Delete
})
[12996] Fix | Delete
});
[12997] Fix | Delete
}
[12998] Fix | Delete
[12999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function