afragen / wp-dependency-installer

A lightweight class to add to WordPress plugins/themes to automatically install plugin dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clear admin dismissable notices cache on plugin deactivation

Raruto opened this issue · comments

Related to: #47 (comment)

if ( class_exists( '\PAnd' ) && ! \PAnD::is_admin_notice_active( $dismissible ) ) {
  continue;
}

Find a way to display dismissed nag notifications again when the plugin is reactivated in a short time ( or define some sort of debug / development mode )

The developer may use a filter to set the amount of time this notice is dismissable. To force a reset , the data is stored in the options table with an option name beginning with pand.

For development, simply use the filter to set a very short dismissal time. I believe values between 0 and 1 may be used, but I don't completely remember.

https://github.com/afragen/wp-dependency-installer/wiki/Actions-and-Hooks 😉

So any value between 0 and 0.5 will be fine?

add_filter(
  'wp_dependency_timeout',
  function( $timeout, $source ) {
    return 0.1;
  },
  15,
  2
);

persist-admin-notices-dismissal.php#L116

Only one way to find out.

Nope, I don't think it's actually possible, any value between 0 and 1 is automatically converted to "1 day".

Anyway don't worry, I'll take a better look.