-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Remove wp_footer call in legacy widget preview.
#1602
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
Conversation
|
How about if we hide what these hooks output here in a display none div? |
|
While this could work for As the docs specifically state that both functions are intended for output to the frontend, we would ideally not call these functions in the widget editor. However, to reduce BC breaks, we can output enqueued scripts and styles to ensure that the widgets' functionality and styling is maintained in the widget editor. Thoughts? |
|
Yes, I think that could work. Using the Hopefully not using |
|
Some plugins and themes print styles and JS directly within those action hooks, when they find adding extra assets to be overkill, so just trying to print enqueued scripts or styles may have a negative impact on those scenarios. I don't have the solution either, but all these scenarios need to be mentioned and considered. |
|
I've been thinking about this as well @Clorith. To the best of my knowledge, we don't currently have a way to get widget-specific additions to
Based on the discussion so far and current limitations, my thinking for my next update to this PR is:
Naturally, in addition to any extras (do we care about any Reducing the calls to |
|
@costdev I like that output buffering + "parsing" option. It is not very "elegant" but it serves very well the need to preview only the widget but also make sure all the styles and scripts are present 👏🏻 |
|
The e2e tests are failing on the |
That's right, it will need a change upstream. Noted here and at the bottom of this comment. I'm not 100% sure if it will require the changes in both repos or if the change upstream will be enough and the build process will update the |
handle_legacy_widget_preview_iframe()calledwp_footer()on each widget on the Appearance > Widgets screen.This patch removes the call to
wp_footer().PR Update
Following discussion on Trac, a CSS solution is simpler and suggests equal results. The updates to this PR remove the initial changes and implement a CSS based solution instead.
Discussion on Trac included feedback from the accessibility team who have no specific concerns at this moment. Some keyboard only navigation and screen reader testing of the legacy widget preview screen is desirable.
Trac ticket: https://core.trac.wordpress.org/ticket/53801