Plugins' implementation of "Number of Columns" screen option broken

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?

Change History (14)

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.

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?

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.