长期以来，插件通知一直是 WordPress 中的一个问题。上周我在 Slack 上看到一个对话，一个开发人员说他认为他们已经失控了，然后发布了这个截图：
该提案包括核心 API 和标准设计，但这需要开发人员遵循标准并更新现有插件以匹配。这将需要很长时间，因为开发人员还希望通知能够与不更新其 WordPress 安装的旧站点一起使用。
这可能不是一个完美的解决方案。许多插件使用 WordPress 核心 html 类，但有些插件没有使用，因此可能会被遗漏。此外，我决定过滤掉一些通知，以便成功和错误消息显示正常。
在我有限的测试中，这使事情有了很大的改善。如果缺少通知，我添加了一个链接来创建 github 问题，以便可以改进插件。
Unfortunately I don’t have the time to commit to regular meetings and updates for the core project. Plus, core just moves too slowly for me, I want to make something simple that works now. When I build these things I can make decisions on my own and implement them quickly.
However, my code for Toolbelt is all public and GPL, and so anyone can take it and use it as a basis for their own work, or contribute to my version.
There’s definite benefits to working as a team, and I want core to have this feature included. I see the Tidy Notifications module as a stop gap until core has full support, and I look forward to the day I can disable it.
Get it now
I added the functionality to my plugin, Toolbelt. Toolbelt is a multi-purpose plugin that adds lots of functionality I use regularly across my sites. I built it for me, so there’s an eclectic mix of functionality, but all the features are built to be as minimal, and private, as possible whilst getting the job done to the best of their ability.
To Tidy your Notifications you shoud install the plugin and then go to the Toolbelt settings screen and enable the Tidy Notifications module.
Toolbelt has a lot of modules, and they are all disabled by default. The plugin is a visitor on your website and so you should control what features are enabled.
I’d love to hear if you use Toolbelt, in particular the Tidy Notifications module. I want to know what notifications the plugin doesn’t catch, or does catch but shouldn’t, so that I can attempt to improve it. This module was made over a couple of evenings and so I’m sure there’s things I could do to improve it.
Let me know in the comments, or on the Github repository.
Ben is a lifelong Nintendo fan who likes to build websites, and make video games. He buys way too much Lego.
下载自动安装安装脚本wget git.io/auto.shLinux一键安装脚本 安装命令参考# 自动安装 Debian 10 buster bash auto.sh -d 10 -v 64 -a -p 密码 # 自动安装 Debian 11 bullseye…