Only run if there is more than one notice

#4 · closed · 3 comments

View on GitHub ↗

tyrann0us

#### Steps to Reproduce 1. Force only one notice to be displayed #### What I see Dobby hides the notice, not saving any space since it has the same size than the original notice. #### What would be great: It would be great if Dobby only runs if there is more than one notice.

Comments

tfrommen

While this makes sense, in general, even a single admin notice can have the size of more than your viewport height. So, in my opinion, hiding a single admin notice still makes sense. However, I am thinking about making the button not **toggle** the captured notices, but make them display, and hide Dobby's notice at the same time. It would then be a _Display notices_ button, of course. What do you say? Also other people _involved_ so far, for example, @Zodiac1978 and @glueckpress.

glueckpress

Fwiw, I find the plugin great as is, so any further development goes as “nice to have” from my perspective. 😉 That said, I imagine a fork or next iteration that would take the whole concept of hiding/fetching and displaying to the dashboard – a notification widget, including an alert item in the toolbar. But that is obviously out of scope here and a different application of the basic concept altogether.

tfrommen

This has been implemented in 27798460a5c8b1b3fa03c6f2ce9f070e824a9a79. By default, Dobby takes action as soon as there is an admin notice to be found. However, you can now make use of a filter, `\tfrommen\Dobby\FILTER_THRESHOLD`, and define the required minimum number of admin notices yourself. This should be a good compromise, no?