Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
kebbie
/
wp-content
/
plugins
/
extendify
/
src
/
Notifications
:
cta-action.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import apiFetch from '@wordpress/api-fetch'; // The feed has no positive marker for an in-place CTA, only the trigger. const ACTIONS = { unpublished: '/extendify/v1/site-visibility/publish', 'search-engine-block': '/extendify/v1/search-indexing/enable', }; export const ctaActionFor = (notification) => ACTIONS[notification?.trigger] ?? null; export const runCtaAction = (path, onClick) => { onClick(); // Reload on failure too: the saved option decides what renders, not this click. return apiFetch({ path, method: 'POST' }).finally(() => window.location.reload(), ); };