admin管理员组文章数量:1287597
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?
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?
Share Improve this question asked Sep 27, 2021 at 17:24 ZeroNineZeroNine 1133 bronze badges1 Answer
Reset to default 2Where 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.
本文标签: Where are the admin notifications stored
版权声明:本文标题:Where are the admin notifications stored? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741298974a2370979.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论