#9770 closed defect (bug) (invalid)
dynamic_sidebar() should not save widgets on theme preview
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Widgets | Version: | 2.8 |
| Severity: | minor | Keywords: | has-patch dev-feedback |
| Cc: |
Description
when looking a theme that adds widgets and sidebars, dynamic_sidebar() calls currently save the sidebars_widgets option.
this should not happen.
Attachments (1)
Change History (8)
comment:1
Denis-de-Bernardy
— 4 years ago
- Keywords dev-feedback added
comment:2
Denis-de-Bernardy
— 4 years ago
mm, that is_preview() actually is for post previews. so the call is erroneous.
comment:3
in reply to:
↑ description
azaozz
— 4 years ago
Replying to Denis-de-Bernardy:
when looking a theme that adds widgets and sidebars, dynamic_sidebar() calls currently save the sidebars_widgets option.
The option is updated only when $sidebars_widgets['array_version'] = 3 is not set and is_admin() is true. This is a test if the data in the array is in old format which only happens when upgrading WordPress from 2.3 (I think).
comment:4
Denis-de-Bernardy
— 4 years ago
Actually, it's:
wp_get_sidebars_widgets($update = true)
And the update occurs if $update is true and is_admin(), rather than if the array_version is not 3 and is_admin(). But agreed, it's a rather minor.
comment:5
Denis-de-Bernardy
— 4 years ago
- Resolution set to invalid
- Status changed from new to closed
comment:6
Denis-de-Bernardy
— 4 years ago
- Milestone 2.8 deleted
the test could also be a straight false, or !is_admin()...