[wp-trac] [WordPress Trac] #37974: Add multi-panel feature to pages through add_theme_support

WordPress Trac noreply at wordpress.org
Fri Oct 7 22:44:49 UTC 2016


#37974: Add multi-panel feature to pages through add_theme_support
----------------------------+------------------
 Reporter:  karmatosed      |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  4.7
Component:  Themes          |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  ux-feedback     |     Focuses:  ui
----------------------------+------------------

Comment (by bradyvercher):

 I went ahead and took a shot at implementing the Customizer aspect of this
 in [attachment:37974.diff]. It's pretty similar in concept to a control I
 built for selecting featured content in the past, so I honed in on that
 thought and built this out as a generic, reusable "Post Collection"
 control.

 When themes add support for Front Page Sections, an instance of the
 control is automatically registered in the Static Front Page section. To
 test the patch, drop this snippet in a theme's functions.php:

 {{{
 add_action( 'after_setup_theme', function() {
         add_theme_support( 'front-page-sections' );
 } );
 }}}

 This patch doesn't handle anything on the front end at the moment -- it's
 limited to the Customizer UI. Selected pages are saved in the
 `front_page_sections` theme mod as a comma-separated list.

 I tried to keep naming fairly generic so that some of the components could
 be re-used and potentially reduce duplicate styles for widgets and nav
 menus in the future, but that would be handled separately. Some work still
 needs to be done to make sure everything looks good on mobile, is
 accessible, and is organized/namespaced properly, but it should be a solid
 start.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37974#comment:86>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list