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

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
/home/sportsfe.../httpdocs/wp-conte.../plugins/leadin/scripts/utils
File: withMetaData.ts
import { withSelect, withDispatch, select } from '@wordpress/data';
[0] Fix | Delete
[1] Fix | Delete
// from answer here: https://github.com/WordPress/gutenberg/issues/44477#issuecomment-1263026599
[2] Fix | Delete
export const isFullSiteEditor = () => {
[3] Fix | Delete
return select && !!select('core/edit-site');
[4] Fix | Delete
};
[5] Fix | Delete
[6] Fix | Delete
const applyWithSelect = withSelect((select: Function, props: any): any => {
[7] Fix | Delete
return {
[8] Fix | Delete
metaValue: select('core/editor').getEditedPostAttribute('meta')[
[9] Fix | Delete
props.metaKey
[10] Fix | Delete
],
[11] Fix | Delete
};
[12] Fix | Delete
});
[13] Fix | Delete
[14] Fix | Delete
const applyWithDispatch = withDispatch(
[15] Fix | Delete
(dispatch: Function, props: any): any => {
[16] Fix | Delete
return {
[17] Fix | Delete
setMetaValue(value: string) {
[18] Fix | Delete
dispatch('core/editor').editPost({ meta: { [props.metaKey]: value } });
[19] Fix | Delete
},
[20] Fix | Delete
};
[21] Fix | Delete
}
[22] Fix | Delete
);
[23] Fix | Delete
[24] Fix | Delete
function apply<T>(el: T): T {
[25] Fix | Delete
return applyWithSelect(applyWithDispatch(el));
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
export default apply;
[29] Fix | Delete
[30] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function