#21042 closed defect (bug) (wontfix)
Plugins' implementation of "Number of Columns" screen option broken
Reported by: | DJPaul | Owned by: | azaozz |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | normal | Version: | 3.4 |
Component: | Administration | Keywords: | close |
Focuses: | Cc: |
Description
Plugins that have implemented the "Number of columns" screen option by copy/pasting the implementation from the edit-form-advanced.php template are broken in 3.4.
Examples of affected plugins are BuddyPress 1.6 beta 1, and AVH Extended Categories Widgets v3.6.4. To recreate, load up either of these plugins' admin screens and try changing the "Number of Columns" screen option. Nothing happens. No javascript errors reported in the browser.
This was introduced by r20272, where the $screen_layout_columns stuff was moved from #poststuff to #post-body.
While this is part of core that has been copy/pasted due to the functionality being unable to be implemented via a central helper method (or the like), could consideration be given to a backpat fix, perhaps via javascript?
Attachments (2)
Change History (14)
#3
follow-up:
↓ 5
@
12 years ago
- Priority changed from normal to low
Is there anything we can do to make [20272] compatible with existing plugin usage, via a few extra CSS declaration blocks or something similar?
#5
in reply to:
↑ 3
@
12 years ago
Replying to nacin:
Is there anything we can do to make [20272] compatible with existing plugin usage...
The old structural css wasn't removed despite that it's not used in core any more, so plugins using that layout would not break. To keep columns switching working the "old" way, the old JS would need to be restored too.
The bigger problem here is: how long should we keep supporting plugins that copy something from core, and would they switch to using more "independent" methods if the old method still works?
#6
@
12 years ago
- Keywords close added
Best would be if these plugins implement something like my-script.js above until column switching is abstracted into an API.
#7
@
12 years ago
Anyone that copies code out of files in wp-admin literally gets what they paid for. Short term, I think it's up to plugin authors to keep up with WordPress core when we/they use code without trusted conventions. Long term, this specific nook needs a trusted convention so plugins can avoid this situation in the future.
#9
@
12 years ago
- Cc diegotdai added
On line 11 $('.postbox-container:visible').lengt; is missing h for length?
var n = parseInt($(this).val(), ps = $('#poststuff'), visible = $('.postbox-container:visible').lengt;
As the reporter said this is part of the Edit Post screen, not an API intended for use by plugins. If some plugins have copied the way it works on that screen, perhaps they should update to use more "independent" method.
Best would be to abstract it into an API, don't think this should be in 3.4.1 though.