: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import { withSelect, withDispatch, select } from '@wordpress/data';
// from answer here: https://github.com/WordPress/gutenberg/issues/44477#issuecomment-1263026599
export const isFullSiteEditor = () => {
return select && !!select('core/edit-site');
const applyWithSelect = withSelect((select: Function, props: any): any => {
metaValue: select('core/editor').getEditedPostAttribute('meta')[
const applyWithDispatch = withDispatch(
(dispatch: Function, props: any): any => {
setMetaValue(value: string) {
dispatch('core/editor').editPost({ meta: { [props.metaKey]: value } });
function apply<T>(el: T): T {
return applyWithSelect(applyWithDispatch(el));