Join GitHub today
New event that lets plugins trigger notifications in the admin area #11483
They have to be triggered before assigning the notifications to the view and there is no other way to determine when a plugin is supposed to trigger notifications in the admin. Ideally, in the future we would even move the notifications above to CoreAdminHome or somewhere else eventually.
First thought of using
Plugins could actually also use this event to cancel notifications where in the past it was needed to hide them via CSS.
Happy about any other naming suggestions but want to keep it "specific" to notifications and not something to general like
Not sure if
Couldn't the method
There is also the problem that some controllers do not extend the admin controller like ScheduledReports (even though it is shown in the admin) and the notification wouldn't appear there.
I trigger the event there because this is the place where we also show all the other notifications like invalid plugins, invalid license, php version is EOL, debug mode is enabled, etc and this is shortly before we assign the notifications to the admin view. So at least we make sure to be consistent and show them together or none. From what I saw eg in scheduled reports controller it then calls
At some point we really need to refactor this and have only one controller and more clear indication whether it is an admin page, a reporting page or a regular standalone page like All Websites Dashboard but for now there is not really another place for it.
Later we could also add an event