/* global wphb */ import Fetcher from './utils/fetcher'; const { PluginPostStatusInfo } = wp.editPost; const { registerPlugin } = wp.plugins; const { select, dispatch } = wp.data; /** * Handle clear cache action. */ const handleClearCache = () => { const postId = select( 'core/editor' ).getCurrentPostId(); Fetcher.caching.clearCacheForPost( postId ).then( showNotice ); }; /** * Show notice. */ const showNotice = () => { const notices = select( 'core/notices' ).getNotices(); if ( ! notices.find( ( notice ) => notice.id === 'wphb-gb-notice' ) ) { dispatch( 'core/notices' ).createNotice( 'success', wphb.strings.notice, { id: 'wphb-gb-notice' } ); } }; /** * Add clear cache button. * * @return {*} Element * @class */ const MyPluginPostStatusInfo = () => ( ); registerPlugin( 'wphb', { render: MyPluginPostStatusInfo } ); x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586