Changelog
2.0.0
Rebrand from DuckDev to FoxeLabs, combined with a full restructure onto the same PSR-4, dependency-injected shape as the other FoxeLabs libraries. Clean break — no compatibility shim from 1.x.
No data migration needed
Flash notices are transient by design: the only thing the old storage can hold at upgrade time is a notice queued moments earlier and not yet shown. Rewriting your call sites is the whole job — see Migrating from 1.x.
Changed
- Composer package renamed
duckdev/wp-flash-notices→foxelabs/wp-flash-notices. Update yourcomposer.jsonrequire entry. - Class renamed
DuckDev\WP_Flash_Notices→FoxeLabs\Notices\Notices, autoloaded via PSR-4 underFoxeLabs\Notices\(was a classmapped single file). - The constructor now takes a prefix rather than a transient name, and has no side effects — call
register()to attach the hooks. 1.x hooked WordPress from the constructor. - Every hook name is now scoped to that prefix:
wp_flash_notices_*→{prefix}_flash_notices_*/{prefix}_flash_notice_*, andfront_notices→{prefix}_front_notices. Two plugins on one site no longer answer each other's filters. get()returns aNoticeobject ornull;fetch()returnsNotice[]. Both returned raw arrays in 1.x.- Stored queues now carry an expiration (default one day, configurable on
TransientStore), so an unread queue cannot linger in the options table forever. - Site and network queues use distinct storage keys (
{prefix}_flash_noticesand{prefix}_network_flash_notices). - Minimum PHP raised to 7.4 (was 5.4).
Added
StoreInterfaceandRendererInterface, so storage and markup are swappable by constructor injection.Notice— an immutable value object for a single notice, withto_array()/from_array()for storage.Notices::get_instance( $prefix )— same prefix returns the same container, so notices can be queued from anywhere without passing the object around.types(),prefixer(),store()andrenderer()accessors. Notice types are now resolved per call, so a filter registered after construction still applies.- A malformed stored row is skipped rather than rendered, so bad data cannot fatal a page.
- Full unit test suite plus GitHub Actions for tests, PHPCS and releases.
Fixed
- Network notices were saved from the wrong queue.
save()wrote the site queue into the network transient, so network notices were never stored and the two queues clobbered each other. - Notices were not reliably cleared after rendering. The auto-clear callback was hooked with mismatched arguments (
$transient, $noticeswhere it expected$notices, $network), so the wrong value drove the clear. add()discarded the return value of its own notice-item filter, making the filter inert. It is now honoured — return aNoticefrom{prefix}_flash_notice_itemto replace the queued notice.
Removed
clear_after_render(). Clearing is internal torender(), still gated by{prefix}_flash_notices_auto_clear.
1.0.1
Added
wp_flash_notices_notice_typesfilter for registering custom notice types.front_noticesaction for printing notices in front-end templates.
Fixed
- Notices were fetched with the wrong value passed through to the transient lookup.
1.0.0
Initial release, as duckdev/wp-flash-notices.

