Dismissable notice always returning
-
Hi! I haven’t troubleshooted to find if it’s a conflict with another plugin… When editing a page/post, the “Enjoying Otter Blocks?” notice always comes back.
I’m using the following to remove it:
add_action( 'enqueue_block_editor_assets', function () { $script = <<<HTML jQuery( window ).load(function() { const getNotices = wp.data.select( 'core/notices' ).getNotices(); getNotices.forEach((v,i)=>{ if (v.content.includes('Otter')) wp.data.dispatch( 'core/notices' ).removeNotice(v.id) }); }); HTML; wp_add_inline_script( 'wp-blocks', $script );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Dismissable notice always returning’ is closed to new replies.