Notices in the Block Editor with multiple lines
The page https://developer.wordpress.org/block-editor/how-to-guides/notices/ has the following code for adding a notice to the block editor:
( function ( wp ) {
wp.data.dispatch( 'core/notices' ).createNotice(
'success', // Can be one of: success, info, warning, error.
'Post published.', // Text string to display.
{
isDismissible: true, // Whether the user can dismiss the notice.
// Any actions the user can perform.
actions: [
{
url: '#',
label: 'View post',
},
],
}
);
} )( window.wp );
This works fine for me and I get my message to display just fine. But I want to display a message with multiple lines where I chose where the line breaks are.
I've tried Post br / published
, Post \n published
, Post \r\n published
but nothing displays the words on separate lines.
can't find any options on https://developer.wordpress.org/block-editor/reference-guides/data/data-core-notices/ that would help me either.
Topic block-editor notices Wordpress
Category Web