Created
January 26, 2019 16:44
-
-
Save httpstersk/f62315afd07074b56bf3bafeccdddfda to your computer and use it in GitHub Desktop.
➊➏ Create an admin notice with custom styled HTML element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NOTICE_STATUS = 'success'; // Available: info, success, warning, error | |
const HTML_ELEMENT = '<h1 style="text-align: center">Gutenberg ist gut! 🙌</h1>'; | |
const { dispatch } = wp.data; | |
const { createNotice } = dispatch( 'core/notices' ); | |
createNotice( NOTICE_STATUS, HTML_ELEMENT, { __unstableHTML: true } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment