How to stop showing admin notice after close button has been clicked

Two ways to handle this. a. Attach a timer to the notice: You could attach a 3-second timer (or however long you wish) to the notice, as follows: <?php set_transient( “my-plugin”, “alive”, 3 ); add_action( ‘admin_notices’, function() { //Syntax correction if ( “alive” == get_transient( “my-plugin” ) ) { ?> <div class=”notice notice-success is-dismissible”> <p><?php … Read more

How to pass parameters to admin_notices?

I think a better implementation would be a “message” class e.g.: class WPSE_224485_Message { private $_message; function __construct( $message ) { $this->_message = $message; add_action( ‘admin_notices’, array( $this, ‘render’ ) ); } function render() { printf( ‘<div class=”updated”>%s</div>’, $this->_message ); } } This allows you to instantiate the message at any time prior to rendering: … Read more

Annoying “JQMIGRATE: Migrate is…” in console after update to WordPress 4.5

WordPress uses the jQuery migrate script to ensure backwards compatibility for any plugins or themes you might be using which use functionality removed from newer versions of jQuery. With the release of WordPress 4.5, it appears they have upgraded the version of jQuery migrate from v1.2.1 to v1.4.0 – Having a quick scan through the … Read more