# extendify/trunk/src/Notifications/publish-site.js

Extendify, version trunk. 18 lines.

- Page: https://pluginprobe.com/plugins/extendify/trunk/code/src/Notifications/publish-site.js
- Raw: https://pluginprobe.com/plugins/extendify/trunk/raw/src/Notifications/publish-site.js
- Modified: 2026-09-16T19:34:02+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/trunk/code/src/Notifications/publish-site.js#L10-L20`.

```javascript
import apiFetch from '@wordpress/api-fetch';

// The feed has no positive marker for a publish CTA, only this trigger.
export const publishesSite = (notification) =>
	notification?.trigger === 'unpublished';

export const publishSite = () =>
	apiFetch({
		path: '/extendify/v1/site-visibility/publish',
		method: 'POST',
	});

export const publishAndReload = (onClick) => {
	onClick();
	// Reload on failure too: the saved option decides visibility, not this click.
	return publishSite().finally(() => window.location.reload());
};

```
