[wp-trac] [WordPress Trac] #23450: Refactor menu item meta boxes as accordion

WordPress Trac noreply at wordpress.org
Thu Mar 14 08:18:10 UTC 2013


#23450: Refactor menu item meta boxes as accordion
-----------------------------------------------+--------------------
 Reporter:  lessbloat                          |       Owner:
     Type:  enhancement                        |      Status:  new
 Priority:  normal                             |   Milestone:  3.6
Component:  Menus                              |     Version:  trunk
 Severity:  normal                             |  Resolution:
 Keywords:  3.6-menus needs-testing has-patch  |
-----------------------------------------------+--------------------

Comment (by DrewAPicture):

 After some discussion [https://irclogs.wordpress.org/chanlog.php?channel
 =wordpress-dev&day=2013-03-14&sort=asc#m574557 in IRC] tonight, I decided
 to try a new approach to this with [attachment:23450.9.diff]

 It introduces three new functions:
 1. `do_menu_accordion_sections()`
 2. `add_menu_accordion_section()`
 3. `remove_menu_accordion_section()`

 The `add|remove_menu_accordion_section()` functions are really just
 wrappers for `add|remove_meta_box()` but the idea is to reinforce that
 though we're ''technically'' still working with meta boxes, we're actually
 adding accordion sections.

 The naming convention is hardly set in stone, so that's open to
 suggestions. Maybe `do_menu_sections()`, `add|remove_menu_sections()`?

 There are several big pros for taking this approach:
 * It reduces the number of affected lines by about half (-400 lines)
 * It reinforces the idea that we're working with accordion sections,
 rather than meta boxes
 * It's fully backward-compatible with the meta box API

 On another note, I decided to reintroduce the ability to hide individual
 accordion sections via Screen Options. I felt that since we've removed the
 ability to re-sort the sections, some people would appreciate (and expect)
 the ability to hide sections they don't use.

 '''Next Steps:'''

 23450.9 is a first pass at the new approach and we'll need to work out the
 kinks in terms of adding back the proper selectors to properly hide
 accordion sections. Feedback is welcome and encouraged.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23450#comment:28>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list