I am working on a plugin and in plugin i use admin_notices
hook for showing my custom message. When a user activate plugin the message show blew the plugin activate
successfully, but my message shows all the other admin pages.
I want to show message only the plugins page after plugin activate or my plugin settings page. I don't know how can i fix this.
Here is my code:
add_action('admin_notices', 'wpc_plugin_notices');
function wpc_plugin_notices() {
$plugin = plugin_basename(__FILE__);
if (is_plugin_active($plugin)) {
echo "<div class='updated'>
<p>
Please go to this page
<a href='".site_url()."/wp-admin/edit.php?post_type=wpcproduct&page=image_resize&action=wpc_resize&products=1'>Click Here</a>
</p>
</div>";
}
}
Please guide me how can i fix this.