[wp-trac] [WordPress Trac] #37661: A New Experience for Discovering, Installing, and Previewing Themes in the Customizer

WordPress Trac noreply at wordpress.org
Tue Oct 10 07:08:55 UTC 2017


#37661: A New Experience for Discovering, Installing, and Previewing Themes in the
Customizer
-------------------------------------+-------------------------------------
 Reporter:  celloexpressions         |       Owner:  westonruter
     Type:  feature request          |      Status:  closed
 Priority:  high                     |   Milestone:  4.9
Component:  Customize                |     Version:  4.2
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-screenshots has-     |     Focuses:  ui, accessibility,
  user-testing has-patch needs-      |  javascript
  testing ux-feedback commit         |
-------------------------------------+-------------------------------------

Comment (by westonruter):

 In [changeset:"41807"]:
 {{{
 #!CommitTicketReference repository="" revision="41807"
 Customize: Improve behavior and extensibility of theme loading and
 searching.

 * Introduce `WP_Customize_Themes_Section::$filter_type`, which has built-
 in functionality for `local` and `remote` filtering. When this set to
 `local`, all themes are assumed to be loaded from Ajax when the section is
 first loaded, and subsequent searching/filtering is applied to the loaded
 collection of themes within the section. This is how the core "Installed"
 section behaves - third-party sources with limited numbers of themes may
 consider leveraging this implementation. When this is set to `remote`,
 searching and filtering always triggers a new remote query via Ajax. The
 core "WordPress.org" section uses this approach, as it has over 5000
 themes to search.
 * Refactor `filterSearch()` to accept a raw term string as input. This
 enables a feature filter to be used on a section where `filter_type` is
 `local`.
 * Refactor `filter()` on a theme control to check for an array of terms.
 Also sort the results by the number of matches. Rather than searching for
 an exact match, this will now search for each word in a search distinctly,
 allowing things like tags to rank in search results more accurately.
 * Split `loadControls()` into two functions for themes section JS:
 `loadThemes()` to initiate and manage an Ajax request and `loadControls()`
 to create theme controls based on the results of the Ajax call. If third-
 party sections need to change the way controls are loaded, such as by
 using a custom control subclass of `WP_Customize_Theme_Control`, this
 allows them to use the core logic for managing the Ajax call and only
 override the actual control-creation process.
 * Introduce `customize_load_themes` filter to facilitate loading themes
 from third-party sources (or modifying the results of the core sections).
 * Bring significant improvements to the installed themes search filter.

 Props celloexpressions.
 Amends [41648].
 See #37661.
 Fixes #42049.
 }}}

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


More information about the wp-trac mailing list