-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix(ia): hide notifications #3563
Conversation
I'm going to look into this today:
|
PR write-up above has been updated for moving code into the wizard class. Ready for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the refactor @ronchambers , this is looking great! One thing I noticed is this change isn't affecting Network Wizards. Looks like the constructor in Network_Wizard
is missing parent::__construct();
thanks @jaredrethman - the parent construct issue was just fixed in this PR: #3479 (comment) Once both PRs are merged, the issue will solve itself; the Network Wizard will hide notices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ronchambers thanks for addressing my feedback. Code is approved!
All Submissions:
Changes proposed in this Pull Request:
The current "hide notifications" code needed some fixes to work for the current wizards and new wizards too.
This new solution moves
remove_notifications()
from the newspack class to the wizard abstract class.To get an idea of what notifications are being removed, please see this PR that was leaving the notices in place, but just adding margin. We've now since decided/fixed that we'll actually remove the notices instead.
Another fix/change that was made was to move the rendering hook for the "admin-header-only" wizards to
in_admin_header
instead ofall_admin_notices
because we were removing the action that was also being used for rendering. Because of this hook change, the location in the HTML where the admin-header was being rendered changed, so we needed to adjust the CSS based on this new HTML location. Mainly this was needed to fix the mobile layout.Finally, the CSS that originally added margins to the notifications (instead of removing notifications) was allowed to stay in the CSS (with some refactoring). This is kind of a "fall-back" in case the PHP doesn't hide a notice for some reason it will still look OK on the page.
Testing:
When testing, no notices should appear on any wizards (except WordPress core notices like "1 post moved to trash" and "saved").
For Wizards that are "admin-header-only" on CPT pages, notices such as "post moved to trash" and other "bulk/edit" actions will still show. These are internal to WordPress and provide helpful feedback to users/admins.
Settings pages such as Network > Site Role (
admin.php?page=newspack-network
) will show a "saved" notice like the attached since these are rendered by core and are not removed.How to test the changes in this Pull Request:
npm run build
Other information: