Troubleshooting Admin_Notice

Question

I have this code at the top of a plugin:

 function my_mwe_admin_notice(){
    echo '<div class="notice notice-error">';
    echo '<h1>Notice this.</h1>';
    echo '</div>';
 }
add_action( 'admin_notices', 'my_mwe_admin_notice' );

Where and when is this notice supposed to appear?

I can’t find it.

Have also tried adding global $pagenow and if ( 'plugins.php' == $pagenow ) { // also index.php, etc...

What am I missing?

0
, MikeiLL 8 months 0 Answers 97 views 0

Leave an answer