# leadin/11.3.65/scripts/utils/withMetaData.ts

HubSpot All-In-One Marketing – Forms, Popups, Live Chat, version 11.3.65. 31 lines.

- Page: https://pluginprobe.com/plugins/leadin/11.3.65/code/scripts/utils/withMetaData.ts
- Raw: https://pluginprobe.com/plugins/leadin/11.3.65/raw/scripts/utils/withMetaData.ts
- Modified: 2026-07-10T16:14:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/leadin/11.3.65/code/scripts/utils/withMetaData.ts#L10-L20`.

```typescript
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: any = withSelect((select: Function, props: any): any => {
  return {
    metaValue: select('core/editor').getEditedPostAttribute('meta')[
      props.metaKey
    ],
  };
});

const applyWithDispatch: any = withDispatch(
  (dispatch: Function, props: any): any => {
    return {
      setMetaValue(value: string) {
        dispatch('core/editor').editPost({ meta: { [props.metaKey]: value } });
      },
    };
  }
);

function apply<T>(el: T): T {
  return applyWithSelect(applyWithDispatch(el));
}

export default apply;

```
