-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip 'all_admin_notices' for Gutenberg pages? #6315
Comments
FYI - for now I'm using this:
|
Might not need documentation for this if the underlying implementation problem is addressed, but we'll wait and see… |
Related: #11604 will attempt to detect and transparently upgrade all notices output from the server, including from |
@aduth Thanks sir! We'll close this out when that gets merged; sounds like we won't need back-compat documentation here. |
#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 |
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?
Thanks,
js.
The text was updated successfully, but these errors were encountered: