# convertkit/3.4.4/resources/backend/js/legacy-resource-notice.js

Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages, version 3.4.4. 48 lines.

- Page: https://pluginprobe.com/plugins/convertkit/3.4.4/code/resources/backend/js/legacy-resource-notice.js
- Raw: https://pluginprobe.com/plugins/convertkit/3.4.4/raw/resources/backend/js/legacy-resource-notice.js
- Modified: 2026-08-10T03:33:08+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/convertkit/3.4.4/code/resources/backend/js/legacy-resource-notice.js#L10-L20`.

```javascript
/**
 * Renders a non-dismissible warning notice inside Gutenberg
 * when a post/page references a legacy Kit resource.
 *
 * @author ConvertKit
 * @since  3.3.7
 */

document.addEventListener('DOMContentLoaded', function () {
	// Bail if the notice data is not available.
	if (typeof convertkit_legacy_resource_notice === 'undefined') {
		return;
	}

	// Bail if no warnings are found.
	if (
		typeof convertkit_legacy_resource_notice.warnings === 'undefined' ||
		convertkit_legacy_resource_notice.warnings.length === 0
	) {
		return;
	}

	// Bail if Gutenberg is not available.
	if (
		typeof wp === 'undefined' ||
		typeof wp.data === 'undefined' ||
		typeof wp.data.dispatch !== 'function'
	) {
		return;
	}

	// Build the notice.
	// Gutenberg's Notice component renders `message` as plain text with
	// `white-space: normal`, so `\n` collapses to a space and any leading
	// `- ` dashes look odd. Inline the items with `; ` separators instead —
	// this reads naturally on the single line the component actually renders.
	const message =
		convertkit_legacy_resource_notice.intro +
		' ' +
		convertkit_legacy_resource_notice.warnings.join('; ');

	// Create the notice.
	wp.data.dispatch('core/notices').createWarningNotice(message, {
		id: convertkit_legacy_resource_notice.id,
		isDismissible: false,
	});
});

```
