-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[edit-widgets beta] Preload widgets #24855
Conversation
… of starting with XHR for each widget)
@@ -351,6 +351,17 @@ public static function get_widgets( $sidebar_id ) { | |||
$widget['id_base'] = $instance->id_base; | |||
} | |||
|
|||
if ( $request['context'] === 'edit' && isset( $wp_registered_widget_controls[ $widget_id ]['callback'] ) ) { |
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.
I don't like checking for context
here, but that's a nested field and the core only filters top-level fields based on the context. It seems like an opportunity for a bugfix/new feature :-)
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.
We also should really be moving this to a /widgets
controller ASAP.
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.
Spin this in another issue? I would love this /widgets
endpoint 👍
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.
Another issue works!
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.
Size Change: +73 B (0%) Total Size: 1.17 MB
ℹ️ View Unchanged
|
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.
From my testing the 1st thing is that we need a load spinner on the page. Initially, before this PR at least I saw the areas and their names, but now it's a gray bg with nothing on it.
Description
This PR updates the experimental widgets screen so that it's pre-populated with legacy widgets on the initial load.
Before: (flash of blank state, issuing multiple XHRs)
After: (all forms loaded from the very beginning)
How has this been tested?
/widgets.php
.Types of changes
New feature (non-breaking change which adds functionality)
Checklist: