Adding admin notice on plugin activation can be super useful. For example we can add link to the settings page, giving info about minimum requirement of their server, tutorial links, ask the user to rate our plugin, ask donation, or simply telling them that they are awesome. If you ever try to create an “Admin Notice” on plugin activation. You’ll know that using admin_notices action inside your “activation hook function” didn’t work. But there’s a workaround that. What I mean above is a code like this did not work: /* Register activation hook. */ register_activation_hook( __FILE__, 'my_plugin_activation_hook' ); /**  * Runs only when the plugin is activated.  * @since 0.1.0  */ function my_plugin_activation_hook() {     /* Add admin notice */     add_action( 'admin_notices', 'my_plugin_activation_notice' ); } /**  * Admin Notice on Activation.  * @since 0.1.0  */ function my_plugin_activation_notice(){     ?>              Thank you for using this plugin! You are awesome.          
Share This