admin_notices is not working inside function

Well, this is happening because of hook firing sequence. Hooks actually get loaded from an array(have a look) where admin_notices executes before add_menu_page gets called. Now to show you message in your admin page you can check global $pagenow and the page GET variable by $_GET[‘page’] with an if condition and print your message. Like … Read more

Troubleshooting Admin_Notice

Yup. I threw my test code in the top of the Hello Dolly plugin and there was the notice. That’s when I remembered that I was calling it within a namespace: So needed to referenced that so the WP action could access it: namespace My_Plugin; function my_mwe_admin_notice(){ echo ‘<div class=”notice notice-error”>’; echo ‘<h1>Notice this.</h1>’; echo … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)