f2f3a883d7
* 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. git-svn-id: https://develop.svn.wordpress.org/trunk@41807 602fd350-edb4-49c9-b593-d223f7449a82 |
||
---|---|---|
src | ||
tests | ||
tools/i18n | ||
.editorconfig | ||
.gitignore | ||
.jshintrc | ||
.travis.yml | ||
Gruntfile.js | ||
jsdoc.conf.json | ||
package.json | ||
phpunit.xml.dist | ||
webpack.config.dev.js | ||
webpack.config.prod.js | ||
wp-cli.yml | ||
wp-config-sample.php | ||
wp-tests-config-sample.php |