Opened 3 years ago
Closed 3 years ago
#12439 closed defect (bug) (fixed)
Metaboxes options ignored
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Administration | Version: | 3.0 |
| Severity: | major | Keywords: | has-patch tested commit |
| Cc: | WordPress@… |
Description
Steps to reproduce
On any admin page with meta boxes:
- Open Screen Options.
- Uncheck one of the metabox titles, to hide it.
- Refresh page.
Expected result
Box stays hidden.
Actual result
Hidden metaboxes are reset to default values.
Attachments (4)
Change History (15)
- Keywords has-patch added; needs-patch removed
The problem was that get_user_option() first looks for blog-specific options, but the AJAX calls updated the user-specific options.
12439.diff fixes this.
12439.2.diff uses update_user_option(), making it compatible with get_user_option().
12439.3.diff takes a more "radical" approach and removes the $option = preg_replace('|[^a-z0-9_]|i', '', $option); filter. It has the short-term drawback that users will loose their customizations when upgrading.
comment:4
prettyboymp — 3 years ago
- Keywords tested added
comment:5
prettyboymp — 3 years ago
- Keywords tested removed
scratch that, its working on the dashboard and built in edit pages, but not on custom post_type pages.
- Summary changed from Hidden metaboxes options ignored to Metaboxes options ignored
With 12439.4.diff metaboxes on editing screens other than posts should work too.
comment:8
prettyboymp — 3 years ago
- Keywords tested added
That patch seems to have fixed the custom post_types now.
comment:9
voyagerfan5761 — 3 years ago
- Cc WordPress@… added
comment:10
scribu — 3 years ago
- Keywords commit added
comment:11
ryan — 3 years ago
- Resolution set to fixed
- Status changed from new to closed

I've traced the error to get_hidden_meta_boxes() -> get_user_option().