Commit Graph

181 Commits

Author SHA1 Message Date
Sergey Biryukov
ace077085d I18N: Update translator comment missed in [45676].
See #47771.
Built from https://develop.svn.wordpress.org/trunk@45677


git-svn-id: http://core.svn.wordpress.org/trunk@45488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-25 22:56:55 +00:00
Sergey Biryukov
8e85299a00 General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Props ianbelanger, tobifjellner, SergeyBiryukov.
See #47771.
Built from https://develop.svn.wordpress.org/trunk@45674


git-svn-id: http://core.svn.wordpress.org/trunk@45485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-25 22:45:57 +00:00
Gary Pendergast
24d08a9463 Coding Standards: Move wp-admin/custom-header.php to wp-admin/includes/class-custom-image-header.php
This renames the file containing the `Custom_Image_Header` class to conform to the coding standards.

This commit also includes:
- A new `custom-header.php` that includes the new file, for anyone that may've been including the file directly.
- Replaces references to the old filename with the new filename.

See #47632.


Built from https://develop.svn.wordpress.org/trunk@45654


git-svn-id: http://core.svn.wordpress.org/trunk@45465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-17 06:17:56 +00:00
Gary Pendergast
a571a7d621 Code Modernisation: Fix known instances of array access on data types that can't be accessed as arrays.
PHP 7.4 addes a warning when trying access a null/bool/int/float/resource (everything but array, string and object) as if it were an array.

This change fixes all of these warnings visible in unit tests.

Props jrf.
See #47704.



Built from https://develop.svn.wordpress.org/trunk@45639


git-svn-id: http://core.svn.wordpress.org/trunk@45450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-15 06:25:57 +00:00
Gary Pendergast
4803fc405e Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45590


git-svn-id: http://core.svn.wordpress.org/trunk@45401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-02 23:42:58 +00:00
desrosj
7be747f86d Customize: Remove “Update” link for themes on multisite installs.
In [38887], installing themes in the Customizer was disabled for multisite installs. However, an update link continues to be displayed when a theme update is available. Clicking the link causes a JavaScript error.

This removes that update link because updates cannot actually be performed in the Customizer in this situation.

Props desrosj, earnjam, mukesh27, audrasjb, garrett-eclipse.
Fixes #46997.
Built from https://develop.svn.wordpress.org/trunk@45527


git-svn-id: http://core.svn.wordpress.org/trunk@45338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-06-13 15:31:52 +00:00
Sergey Biryukov
bc8ddf3b38 I18N: Remove unnecessary HTML from "Previewing:" string in WP_Customize_Theme_Control.
Props ramiy.
Fixes #47271.
Built from https://develop.svn.wordpress.org/trunk@45435


git-svn-id: http://core.svn.wordpress.org/trunk@45246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 15:30:53 +00:00
Sergey Biryukov
b08c42eb80 Docs: Correct @type annotation for WP_Customize_Selective_Refresh::$current_partial_id.
Props diddledan.
Fixes #46854.
Built from https://develop.svn.wordpress.org/trunk@45428


git-svn-id: http://core.svn.wordpress.org/trunk@45239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 02:12:52 +00:00
Sergey Biryukov
3e6ed38da1 Docs: Correct @type annotation for WP_Customize_Nav_Menu_Item_Setting::$value.
Props diddledan.
Fixes #46853.
Built from https://develop.svn.wordpress.org/trunk@45427


git-svn-id: http://core.svn.wordpress.org/trunk@45238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 02:10:52 +00:00
Sergey Biryukov
35a2322d32 General: Update support forum links.
There are a lot of places in Core that link to https://wordpress.org/support/ for the support forums, but that's now the URL for HelpHub. The new forums link is https://wordpress.org/support/forums/.

This is a follow-up to [45140], which changed the links in help tabs.

Props dilipbheda.
Fixes #47239. See #46790.
Built from https://develop.svn.wordpress.org/trunk@45412


git-svn-id: http://core.svn.wordpress.org/trunk@45223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-25 14:24:50 +00:00
Sergey Biryukov
44512b0753 I18N: Merge two similar "An unexpected error occurred" strings.
Props ramiy.
Fixes #47035.
Built from https://develop.svn.wordpress.org/trunk@45395


git-svn-id: http://core.svn.wordpress.org/trunk@45206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-24 01:14:52 +00:00
Sergey Biryukov
b6471e9be4 Bootstrap/Load: Remove duplicate leading slashes on inclusion of various files under ABSPATH.
Props dmsnell, birgire, szepe.viktor.
Fixes #46327.
Built from https://develop.svn.wordpress.org/trunk@45190


git-svn-id: http://core.svn.wordpress.org/trunk@44999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-13 04:46:52 +00:00
Andrea Fercia
5c60995bd4 Accessibility: Replace media placeholder clickable divs with buttons.
`<button>` elements are natively interactive, supported by any assistive technology, and must be used instead of non-semantic, non-accessible `<div>` elements.

Also, this change aligns the Media Widgets and the Customizer site icon and site logo controls with the design pattern used in the new Block Editor for similar controls.

Props ramonopoly, welcher, afercia.
Fixes #43151.

Built from https://develop.svn.wordpress.org/trunk@44796


git-svn-id: http://core.svn.wordpress.org/trunk@44628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-05 17:49:52 +00:00
Aaron Jorbin
71cf332e65 Replace usages of basename() with wp_basename() in order to support multibyte filenames
This is focused on the pieces of code that touch media files and the tests that support them. `basename` isn't multibyte compatible out of the box. See http://php.net/basename and https://bugs.php.net/bug.php?id=62119.

See #43170.
Props Viper007Bond.

Built from https://develop.svn.wordpress.org/trunk@44785


git-svn-id: http://core.svn.wordpress.org/trunk@44617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-03-01 20:58:52 +00:00
Sergey Biryukov
d68f13cbc8 Docs: Add missing WP_Customize_Control reference to WP_Customize_Nav_Menu_Control and WP_Customize_Nav_Menu_Item_Control DocBlocks.
Props aniketpatel.
Fixes #46077.
Built from https://develop.svn.wordpress.org/trunk@44772


git-svn-id: http://core.svn.wordpress.org/trunk@44604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-02-28 02:07:51 +00:00
Gary Pendergast
656d8edcaf Docs: Add docblocks for WP_Customize_Header_Image_Control member variables.
Props subrataemfluence.
Fixes #44410.


Built from https://develop.svn.wordpress.org/trunk@44600


git-svn-id: http://core.svn.wordpress.org/trunk@44431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-15 05:54:48 +00:00
Gary Pendergast
05c1030151 Docs: Add docblocks to the members of WP_Widget_Form_Customize_Control.
Props subrataemfluence.
Fixes #44420.


Built from https://develop.svn.wordpress.org/trunk@44498


git-svn-id: http://core.svn.wordpress.org/trunk@44329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-09 05:49:49 +00:00
Gary Pendergast
3d918be94e Docs: Add a missing @global to the WP_Customize_Date_Time_Control::get_month_choices() docblock.
Props utsav72640.
Fixes #45500.


Built from https://develop.svn.wordpress.org/trunk@44459


git-svn-id: http://core.svn.wordpress.org/trunk@44290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 05:24:49 +00:00
Gary Pendergast
f3656e2695 Docs: Add a reference to WP_Customize_Control from the WP_Customize_Nav_Menu_Locations_Control docblock.
`WP_Customize_Control` is the parent class of `WP_Customize_Nav_Menu_Locations_Control`.

Props utsav72640.
Fixes #45570.


Built from https://develop.svn.wordpress.org/trunk@44458


git-svn-id: http://core.svn.wordpress.org/trunk@44289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-08 05:18:50 +00:00
desrosj
be0b403077 Docs: Future-proof comments referencing 5.0 TODOs.
Some Customizer-related files contain inline comments referencing work to do for #42364 for 5.0. Those comments are now outdated as #42364 was moved to the 5.1 milestone.

Merges [43887] to trunk.

Props dlh, pento.
Fixes #45115.
Built from https://develop.svn.wordpress.org/trunk@44228


git-svn-id: http://core.svn.wordpress.org/trunk@44058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:07:55 +00:00
jrf
f2d0e69030 I18n: Improve translators comments [2].
* Add missing translators comments.
* Fix placement of some translators comments.
  Translators comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools.
  The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translators comments.

Patch `44360.wp-includes_customize.3.patch` of the series.

Props marcomartins, mihaiiceyro, michielatyoast
See #44360

Built from https://develop.svn.wordpress.org/trunk@43596


git-svn-id: http://core.svn.wordpress.org/trunk@43425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-30 12:36:24 +00:00
Gary Pendergast
56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


Built from https://develop.svn.wordpress.org/trunk@43571


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Sergey Biryukov
cd4c960a6c Administration: Change all the occurrences of "(opens in a new window)" to "(opens in a new tab)".
Props chetan200891, ianbelanger, afercia.
Fixes #43803.
Built from https://develop.svn.wordpress.org/trunk@43174


git-svn-id: http://core.svn.wordpress.org/trunk@43003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-05 09:45:22 +00:00
Sergey Biryukov
3e232e8f1e Customize: Correct closing tag in WP_Customize_Theme_Control::content_template().
Props itowhid06.
Fixes #43945.
Built from https://develop.svn.wordpress.org/trunk@43166


git-svn-id: http://core.svn.wordpress.org/trunk@42995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-04 01:03:22 +00:00
Dominik Schilling
888236585c Customize: Remove a stray whitespace.
Props tfrommen.
Fixes #43762.

Built from https://develop.svn.wordpress.org/trunk@42975


git-svn-id: http://core.svn.wordpress.org/trunk@42804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-04-13 15:10:20 +00:00
John Blackbourn
2361ca884f Docs: Document more parameters and properties using typed array notation.
See #41756

Built from https://develop.svn.wordpress.org/trunk@42876


git-svn-id: http://core.svn.wordpress.org/trunk@42706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-25 19:33:31 +00:00
Sergey Biryukov
4848a09b35 I18N: Use the actual placeholder instead of a number in translator comments if the corresponding string does not use numbered placeholders.
Add missing translator comments in `WP_Theme_Install_List_Table` and `wp_notify_postauthor()`.
Add missing commas in some translator comments.

Fixes #43523.
Built from https://develop.svn.wordpress.org/trunk@42827


git-svn-id: http://core.svn.wordpress.org/trunk@42657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-11 16:44:34 +00:00
Sergey Biryukov
0e802a627d General: Introduce WP_Error::has_errors() method and use it where appropriate.
Props robdxw, DrewAPicture, SergeyBiryukov.
Fixes #42742.
Built from https://develop.svn.wordpress.org/trunk@42761


git-svn-id: http://core.svn.wordpress.org/trunk@42591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-27 02:31:31 +00:00
Sergey Biryukov
08227812a0 Docs: Remove @static notations from method DocBlocks in wp-includes/* classes.
This tag has been used in the past, but should no longer be used. Just using the `static` keyword in code is enough for PhpDocumentor on PHP5+ to recognize static variables and methods, and PhpDocumentor will mark them as static.

Props birgire.
See #42803.
Built from https://develop.svn.wordpress.org/trunk@42746


git-svn-id: http://core.svn.wordpress.org/trunk@42576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-25 20:22:30 +00:00
Sergey Biryukov
5cfda780d8 Customize: Correct "Add Items" button reference in help text shown after creating a new menu.
Props dlh, munyagu, rishishah.
Fixes #42565.
Built from https://develop.svn.wordpress.org/trunk@42568


git-svn-id: http://core.svn.wordpress.org/trunk@42397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-23 12:03:30 +00:00
Sergey Biryukov
9cb44f5f2f Themes: Improve line wrapping in feature filter on Theme Install screen and in the Customizer.
Props chetan200891 for initial patch.
Fixes #42871.
Built from https://develop.svn.wordpress.org/trunk@42447


git-svn-id: http://core.svn.wordpress.org/trunk@42277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-15 19:27:53 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Gary Pendergast
a779284c00 General: Reformat inline if () statements inside HTML tags.
This pattern occurs a handful of times across the codebase:

`<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">`

Unfortunately, it doesn't really play nicely with `phpcbf`, so all instances need to be removed in preperation for auto code formatting.

See #41057.


Built from https://develop.svn.wordpress.org/trunk@42217


git-svn-id: http://core.svn.wordpress.org/trunk@42046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-23 04:09:49 +00:00
Weston Ruter
c15b2a0908 Customize: Fall back to ISO date format for date/time control inputs if year, month, or day are missing from the date_format option.
Amends [42111].
Props dlh, westonruter.
Fixes #42394.

Built from https://develop.svn.wordpress.org/trunk@42117


git-svn-id: http://core.svn.wordpress.org/trunk@41946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-06 20:28:48 +00:00
Weston Ruter
ef272167c4 Customize: Present the date/time control input fields in the same format (and order) as date_format.
Props westonruter, obenland, atachibana for testing, Mirucon for testing.
See #42373, #28721.
Fixes #42394.

Built from https://develop.svn.wordpress.org/trunk@42111


git-svn-id: http://core.svn.wordpress.org/trunk@41940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-02 23:00:49 +00:00
Weston Ruter
ca84147401 Customize: Allow 0:00-0:59 in date/time control when 24-hour time used.
* Let min hour be 0 and max be 23 in 24-hour time; let min hour be 1 and max be 12 in 12-hour time.
* Show error notification when an invalid date value is provided, not just when not a future date.
* Fix translation of custom validity message.
* Start checking for validity after all inputs have been initially populated.
* Remove support for being able to enter 24:00.
* Cease forcing date input elements from being casted to integers, to allow for invalid inputs to be detected.

Props westonruter, Presskopp, peterwilsoncc, atachibana for testing.
See #39896, #28721.
Fixes #42373.

Built from https://develop.svn.wordpress.org/trunk@42042


git-svn-id: http://core.svn.wordpress.org/trunk@41876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-30 16:40:47 +00:00
Weston Ruter
685e3c1a67 Customize: Deprecate nav menu classes that are no longer used, instead of removing them immediately.
* Deprecate PHP classes `WP_Customize_New_Menu_Section` and `WP_Customize_New_Menu_Control`.
* Deprecate JS class `wp.customize.Menus.NewMenuControl`.
* Also introduce `wp.customize.Menus.createNavMenu()` for logic to create nav menus separately from the logic for handling UI interactions.

Amends [41768].
See #40104, #42364.
Fixes #42357.

Built from https://develop.svn.wordpress.org/trunk@42034


git-svn-id: http://core.svn.wordpress.org/trunk@41868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-28 05:48:47 +00:00
Weston Ruter
d348f1624b Customize: Improve Media control accessibility and compatibility for settings passed as arrays or as solitary setting.
* Eliminate Media control template from having dependency on `params.settings.default` for element ID, to fix compat with `params.settings` array or single `params.setting`. See #36167.
* Move description out of label and add `aria-describedby` to Media control's Select button. See #30738, #33085.
* Obtain notification container whenever content is (re-)rendered (such as for Media control). See #38794.
* Re-render notifications after control content is re-rendered, if control is in expanded section. See #38794.

Amends [41390].
See #36167, #38794, #33085, #30738.

Built from https://develop.svn.wordpress.org/trunk@42031


git-svn-id: http://core.svn.wordpress.org/trunk@41865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-27 20:18:47 +00:00
Sergey Biryukov
29d5ee851c I18N: Use a consistent pattern for translator comments for placeholders in some more Customizer strings.
See #41974.
Built from https://develop.svn.wordpress.org/trunk@42006


git-svn-id: http://core.svn.wordpress.org/trunk@41840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 22:47:46 +00:00
Sergey Biryukov
50c6a55fba I18N: Give context to "Installed" string added in [41648].
Props dimadin.
Fixes #42325.
Built from https://develop.svn.wordpress.org/trunk@42002


git-svn-id: http://core.svn.wordpress.org/trunk@41836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-24 21:43:47 +00:00
Konstantin Obenland
91ad9114d0 Customize: Ease extendability of filter drawer
By moving the `wporg` conditional inside the method body, the filter drawer can be overridden without having to also override the entire section template.

Props celloexpressions.
Closes #42212.


Built from https://develop.svn.wordpress.org/trunk@41973


git-svn-id: http://core.svn.wordpress.org/trunk@41807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-23 18:58:46 +00:00
Weston Ruter
81c87e7d5e Code Editor: Improve ability to create Customizer CodeEditorControl instances in JS, lessening PHP dependencies.
Allow `CodeEditorControl` to be instantiated with a `editor_settings` param which is merged with `wp.codeEditor.defaultSettings`.

Also:

* Turn redundant "CSS Code" control label into screen reader text for Additional CSS.
* Remove `code-editor` as script dependency for `custom-html-widgets` since enqueueing is determined by `wp_enqueue_code_editor()`.
* Remove useless exporting of `code_type` param to JS in `WP_Customize_Code_Editor_Control`.
* Add `disabled` class to Custom HTML widget's Save button when linting errors are present.
* Remove redundant `span` inside CodeEditorControl's `label`.

See #41897, #12423, #41872.

Built from https://develop.svn.wordpress.org/trunk@41957


git-svn-id: http://core.svn.wordpress.org/trunk@41791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 16:39:48 +00:00
Sergey Biryukov
33012ad740 Customize: Use typographic quotation marks in the strings added in [41768].
Props audrasjb, tobifjellner.
Fixes #42290. See #40104.
Built from https://develop.svn.wordpress.org/trunk@41956


git-svn-id: http://core.svn.wordpress.org/trunk@41790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-20 14:07:47 +00:00
Weston Ruter
f8d16c8aed Customize: Move control's fallback selection of default content template to renderContent method to align with sections and panels.
* Only use default control content template when a more specific template doesn't exist.
* Remove extraneous whitespace from being output in `WP_Customize_Control::render()` method.
* Move Custom Header template printing to `customize_controls_print_footer_scripts` action.

See #30738.

Built from https://develop.svn.wordpress.org/trunk@41935


git-svn-id: http://core.svn.wordpress.org/trunk@41769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 03:04:49 +00:00
Konstantin Obenland
d8f98b3649 Customize: Unstick filter pane in Theme selector
Prevents the filter pane from blocking the view of theme search results when it's open.
Users are now able to just scroll to view results.

Props rclations.
Fixes #42212.

Built from https://develop.svn.wordpress.org/trunk@41903


git-svn-id: http://core.svn.wordpress.org/trunk@41737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 15:11:46 +00:00
Konstantin Obenland
261f0d8ef2 Customize: Allow menu creation in locations pane
Adds a link to the menu creation workflow from the locations selector in the nav menu control.

Props bpayton, westonruter, Travel_girl, melchoyce, celloexpressions.
Fixes #36279.

Built from https://develop.svn.wordpress.org/trunk@41899


git-svn-id: http://core.svn.wordpress.org/trunk@41733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 14:51:47 +00:00
Weston Ruter
e914c0447c Customize: Add missing filter docs in WP_Customize_Nav_Menu_Item_Setting::sanitize().
Props dlh.
Fixes #42257.

Built from https://develop.svn.wordpress.org/trunk@41894


git-svn-id: http://core.svn.wordpress.org/trunk@41728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 04:57:50 +00:00
Weston Ruter
43b4a2577d Customize: Improve theme browsing UI on small screens.
Props Mahvash-Fatima, melchoyce, celloexpressions.
See #37661.
Fixes #42215.

Built from https://develop.svn.wordpress.org/trunk@41893


git-svn-id: http://core.svn.wordpress.org/trunk@41727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-18 04:06:47 +00:00
Weston Ruter
2866a3cad2 Customize: Vary description for nav menu locations control based on whether it is shown during menu creation.
Also fix issue with initial visibility of notice when there are no menus.

Amends [41823].
Props bpayton, melchoyce, westonruter.
See #42116.
Fixes #42113.

Built from https://develop.svn.wordpress.org/trunk@41832


git-svn-id: http://core.svn.wordpress.org/trunk@41666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 19:38:50 +00:00
Weston Ruter
7b0dbf49fc 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.

Built from https://develop.svn.wordpress.org/trunk@41807


git-svn-id: http://core.svn.wordpress.org/trunk@41641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-10 07:09:52 +00:00