Opened 4 years ago
Closed 3 years ago
#53332 closed defect (bug) (fixed)
Transforming a Legacy Widget to a Block Widget is not possible in WP 5.8
Reported by: | imath | Owned by: | |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Widgets | Keywords: | has-patch |
Focuses: | docs, rest-api | Cc: |
Description
Hi,
I'm currently working on migrating BuddyPress legacy widgets to BuddyPress Blocks to anticipate the introduction of the Widgets Block Editor into WordPress 5.8.
This documentation page is explaining the steps to allow migrating a Legacy Widget to a Block one. I've applied it and it's working fine using the Gutenberg plugin (10.7.1) in WP 5.7.2 as shows the following screen capture :
But as soon as I switch to WordPress trunk (5.8) (having the Gutenberg plugin deactivated), the list of transformations doesn't include anymore the BP Block. Here's a screen capture of the result in 5.8:
Attachments (1)
Change History (15)
This ticket was mentioned in Slack in #core-test by johnbillion. View the logs.
3 years ago
This ticket was mentioned in Slack in #core by desrosj. View the logs.
3 years ago
#6
in reply to:
↑ 3
;
follow-up:
↓ 7
@
3 years ago
- Focuses docs added
- Keywords needs-docs added
Replying to imath:
I've found the reason why. While the documentation page and the Gutenberg plugin are using the Widget's class
$show_instance_in_rest
property. WordPress decided to stop checking this property into the Widgets REST endpoints in favor of looking into the$widget_options['show_instance_in_rest']
property.
@imath thanks for chasing down and identifying the problem.
Replying to imath:
If you think it's not needed, I'd advise to at least update this documentation page (to avoid misleading developers) to explain people now need to include a
$widget_options['show_instance_in_rest'] = true
when registering their widget.
The docs do need to be updated, which can be done upstream in the Gutenberg repo.
What about the patch?
As this is a new feature that hasn't shipped yet, I'm concerned about adding code. Why? The added code has to be maintained in core and could confuse both extenders and contributors.
#7
in reply to:
↑ 6
@
3 years ago
Replying to hellofromTonya:
What about the patch?
As this is a new feature that hasn't shipped yet, I'm concerned about adding code. Why? The added code has to be maintained in core and could confuse both extenders and contributors.
Well, I'm fine with not using the patch. Now I know we need to look into the $widget_options['show_instance_in_rest']
property to have the transfom
function working in WordPress 5.8.
But, the feature already shipped into the Gutenberg plugin and just like me, there might be people already using the transform feature that might be confused like I was to see the transform function is no more working.
#8
@
3 years ago
If it hasn't been completed, I'll sort out the developer documentation upstream now whilst we're waiting for a decision on the patch.
I've found the reason why. While the documentation page and the Gutenberg plugin are using the Widget's class
$show_instance_in_rest
property. WordPress decided to stop checking this property into the Widgets REST endpoints in favor of looking into the$widget_options['show_instance_in_rest']
property.53332.patch is fixing my issue. The patch is a kind of back compatibility mechanism for early testers who got used to the
$show_instance_in_rest
property.If you think it's not needed, I'd advise to at least update this documentation page (to avoid misleading developers) to explain people now need to include a
$widget_options['show_instance_in_rest'] = true
when registering their widget.