WPupdatePHP / wp-update-php

Library to be bundled with WordPress plugins to enforce users to upgrade to supported PHP versions.
GNU General Public License v2.0
79 stars 11 forks source link

Hide recommended version admin notice #22

Open pderksen opened 9 years ago

pderksen commented 9 years ago

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.

coenjacobs commented 9 years ago

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.

pderksen commented 9 years ago

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.

afragen commented 9 years ago

In WP 4.2 all that's needed is to add .notice .is-dismissible classes to the admin notice.

pderksen commented 9 years ago

@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.

coenjacobs commented 9 years ago

Yeah, we'll need to attach an onClick event to that link. Documented in this post on Make.