You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Skip 'all_admin_notices' for Gutenberg pages? #6315
When loading a Gutenberg editing page, the 'all_admin_notices' action is executed.
When saving a Gutenberg post, the 'all_admin_notices' action is executed (with or without metaboxes?).
PHP plugins may create notices, and after these notices are displayed in the 'all_admin_notices' hook, those notices are usually deleted (so they're not displayed again, and again, etc.).
Since Gutenberg hides the 'all_admin_notices' HTML, a jQuery ajax call must be made to fetch notices and display them using Gutenberg functions - unfortunately, since the 'all_admin_notices' action has already been executed (either on page load or when saving a post), those notices may no longer exist and cannot be displayed.
Is it possible to either:
Have Gutenberg unregister all hooks from 'all_admin_notices'.
Or have somekind of constant, function, etc. available for 'all_admin_notices' action hooks so they can check if this is a Gutenberg page and skip the display + deletion of notices?
#11604 was merged, but later (effectively) reverted in #12444. As notices made compatible turned to not be reconcilable with Gutenberg design, they are no longer planned to be inherited. See also Notices data actions for client-side notices documentation.
Or have somekind of constant, function, etc. available for 'all_admin_notices' action hooks so they can check if this is a Gutenberg page and skip the display + deletion of notices?
Activity
jsmoriss commentedon Apr 20, 2018
FYI - for now I'm using this:
danielbachhuber commentedon Jun 27, 2018
Related #5975 #3964
chrisvanpatten commentedon Nov 8, 2018
Might not need documentation for this if the underlying implementation problem is addressed, but we'll wait and see…
aduth commentedon Nov 8, 2018
Related: #11604 will attempt to detect and transparently upgrade all notices output from the server, including from
all_admin_notices.chrisvanpatten commentedon Nov 8, 2018
@aduth Thanks sir! We'll close this out when that gets merged; sounds like we won't need back-compat documentation here.
aduth commentedon May 28, 2019
#11604 was merged, but later (effectively) reverted in #12444. As notices made compatible turned to not be reconcilable with Gutenberg design, they are no longer planned to be inherited. See also Notices data actions for client-side notices documentation.
It should be expected that
WP_Screen::is_block_editorcan be used for this purpose.