#55448 closed defect (bug) (worksforme)
WP_Widget_Block outputs empty container if widget has no output
Reported by: | stiofansisland | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.8 |
Component: | Widgets | Keywords: | has-patch |
Focuses: | ui | Cc: |
Description
There are many widgets that for some reason or another will not output any content, this can be for many reasons, one example would be for a logged in/out user.
When you create your own widget class you have control of the widget() output function and can return an empty string to prevent any output.
The WP_Widget_Block class which is used as a sort of wrapper contains its own widget() class which prevents no output even if the block has no content.
This has left empty boxes showing for many plugins widgets on sites and breaks the backward compatibility of the widgets system.
This should be as easy fix, I will create and submit a patch soon.
Attachments (2)
Change History (13)
#2
@
3 years ago
- Keywords needs-testing added
Hi there!
I've tested this patch and its works for me
Still, I'm adding the needs-testing
label to bring a few extra eyes to this ticket to see if it solves the issue.
#4
follow-up:
↓ 7
@
3 years ago
If there is anything i can do to help with testing (demo sites etc) please let me know.
This ticket was mentioned in Slack in #core by chaion07. View the logs.
3 years ago
#6
@
3 years ago
- Keywords needs-unit-tests added
- Milestone changed from 6.0 to 6.1
- Severity changed from major to normal
- Version changed from 5.9.2 to 5.8
With RC1 due in a few hours, I've moved this on to the next milestone for further follow up.
I've set the version to 5.8 as that is when block widgets were introduced.
#7
in reply to:
↑ 4
@
2 years ago
- Keywords reporter-feedback added
Replying to stiofansisland:
If there is anything i can do to help with testing (demo sites etc) please let me know.
Are you able to provide an example widget class that can be used to demonstrate the correct behavior and step by step instructions to reproduce the incorrect behavior? That would help with testing considerably. Thanks in advance!
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
2 years ago
#9
@
2 years ago
- Milestone changed from 6.1 to Future Release
As per today's bug scrub:
This patch still needs testing (and testing info/example).
As 6.1 RC1 is planned next week, let's move it to Future Release
to make sure it's fully tested before moving it back to another milestone.
Fix