1

I'm looking to add some custom functionality to the admin side and I want to change the way the admin notifications work. Where are the admin notifications stored? And when a user dismisses one, where is that being recorded?

1 Answer 1

2

Where are the admin notifications stored?

They aren't. Admin notices have no storage unless you implement it yourself for your plugin/theme.

WordPress provides hooks and styling for displaying admin notices, but that's it. It might provide styling for dismissible admin notices but it provides no storage or registration mechanisms for persistence.

And when a user dismisses one, where is that being recorded?

It isn't, native WP admin notices don't provide this, it's implemented by the plugin/theme author. They might store this in a cookie, local storage, user meta, etc, you would need to ask each plugin/theme vendor individually. There is currently no general mechanism.


As an aside, there is a feature plugin for creating a notification centre in core, but at the time of writing it has not been merged, and its status is uncertain. You should give it a look.

2
  • By any chance do you know where or how the system keeps track of when an admin user dismisses a WooCommerce notice?
    – ZeroNine
    Commented Sep 28, 2021 at 2:50
  • 1
    EDIT: Nevermind I was able to trace back what I was looking for. Thanks for the info!
    – ZeroNine
    Commented Sep 28, 2021 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.