# extendify/3.2.3/src/Notifications/cta-action.js

Extendify, version 3.2.3. 19 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.2.3/code/src/Notifications/cta-action.js
- Raw: https://pluginprobe.com/plugins/extendify/3.2.3/raw/src/Notifications/cta-action.js
- Modified: 2026-10-08T17:02:48+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/extendify/3.2.3/code/src/Notifications/cta-action.js#L10-L20`.

```javascript
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(),
	);
};

```
