title: How to display toast like this in wordpress admin front side
body: <p>I added this code but it's not working and not showing error either in front of admin side</p>
  <p><a href="https://i.stack.imgur.com/YPX5n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YPX5n.png" alt="enter image description here" /></a></p>
  <pre><code>function sample_admin_notice__error() {
          $class = 'notice notice-error';
          $message = __( 'Irks! An error has occurred.', 'sample-text-domain' );
       
          printf( '&lt;div class=&quot;%1$s&quot;&gt;&lt;p&gt;%2$s&lt;/p&gt;&lt;/div&gt;', esc_attr( $class ), esc_html( $message ) ); 
      }
      add_action( 'admin_notices', 'sample_admin_notice__error' );
  </code></pre>