How to Add Admin Alerts and Error Messages in plugin

 Each notice is essentially a div with the notice class, in addition to another specific one. Green notices use the updated class, red notices use the error class, update nags use the update-nag class. Within this class you can add any content, a single line of text surrounded by a paragraph tag is the usual choice. The HTML for the notices in the screenshot above looks like this:


<div class="updated notice is-dismissable">
    <p>Something has been updated, awesome</p>
</div>
<div class="error notice">
    <p>There has been an error. Bummer</p>
</div>
<div class="update-nag notice">
    <p>You should really update to achieve some awesome instad of bummer</p>
</div>

Post a Comment

0 Comments