-
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
Widget Block: widget_id is undefined when a widget is placed #33152
Widget Block: widget_id is undefined when a widget is placed #33152
Conversation
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.
Tested and it fixes the issue. Not sure about the code though since i'm not familiar with PHP but it looks good to me.
@spacedmonkey PHP linter has some complaints, would you address those please? |
@adamziel Done |
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.
This seems like a reasonable backwards compatibility change.
If we want to steer developers away from using these, we should add some _doing_it_wrong()
notices in core instead of triggering PHP notices.
* Fix notice error * Fix lint
* Fix notice error * Fix lint
* Fix notice error * Fix lint
Some widgets expect for the
widget_id
$args to be set to render the widget without a PHP notice error. Add back the widget_id and widget_name params to call tothe_widget
.See original core code when widget_id and widget_name are populated.
https://github.com/WordPress/wordpress-develop/blob/bdf7dd6299e4453f9d7438de0a0e138d950ec0bf/src/wp-includes/widgets.php#L737-L748
Trac ticket: https://core.trac.wordpress.org/ticket/53548
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).Fixes #33056