PHP Classes

File: src/utils/global-data.ts

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WordPress React Plugin Kit   src/utils/global-data.ts   Download  
File: src/utils/global-data.ts
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WordPress React Plugin Kit
Environment to develop new WordPress plugins
Author: By
Last change:
Date: 1 year ago
Size: 1,040 bytes
 

Contents

Class file image Download
import { __ } from '@wordpress/i18n'; /** * Get global data. * * @param {string} key * * @return {Object | string} Global settings related data. */ export const getGlobalData = (key: string = '') => { const data = typeof window?.cart_pulse === 'undefined' ? {} : window?.cart_pulse; if (typeof data === 'undefined') { return data; } if (!key.length) { return data; } return data[key]; }; /** * Check if PRO is enabled or Not. * * @return {boolean} */ export const hasPro = !!getGlobalData('hasPro'); /** * Get email frequency units. * * @return {Array} */ export const emailFrequencyUnits = [ { label: __('Minute', 'jobplace'), value: 'minute', }, { label: __('Hour', 'jobplace'), value: 'hour', }, { label: __('Day', 'jobplace'), value: 'day', }, ]; /** * Default block content. */ export const defaultBlockContent = `<!-- wp:paragraph --><p>Start your Email template</p><!-- /wp:paragraph -->`;