Hide recommended version admin notice
pderksen opened this issue · comments
It would be nice to see a "hide this" button or link next to the admin notice for the recommended version.
This of course would hide the message forever or at least until a plugin update.
Love this library!
Implementing it today for Simple Stripe Checkout since Stripe PHP (which the plugin includes) now requires PHP 5.3.3 and broke a few user sites who were running PHP 5.2.
Good point. The recommended PHP version notice definitely needs a way (optionally?) to dismiss it, since that will be there for ever and always if the plugin remains active. I don't mind the required version notice to stick forever, as that requires the act of updating the PHP version before it can be used and then the notice will go away automatically anyway.
Agreed. In some plugins I save a setting for admin notices the user chooses to hide, but I'm not sure of what's best here for a drop-in library.
In WP 4.2 all that's needed is to add .notice .is-dismissible
classes to the admin notice.
@afragen That's a great add. I didn't realize WP 4.2 included that until you pointed it out.
Is there a built-in way to make a dismiss action persistent though? Like a hide/dismiss forever sort of thing? That's where I've elected to save a setting for this in some of my plugins.
Yeah, we'll need to attach an onClick
event to that link. Documented in this post on Make.