* Removes double `margin-bottom` from all the media controls.
* All media controls now send `{settingId}-attachment-data` messages to the preview when a media setting is updated so that the preview has access to the attachment data.
* Fixes receiving of `attachment-data` message for `custom_logo` which resulted in instant JS-applied preview not working. See #36096.
See #33755.
Fixes#35941.
Built from https://develop.svn.wordpress.org/trunk@36851
git-svn-id: http://core.svn.wordpress.org/trunk@36818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes overly-zealous filtering of autofocus panels, sections, and controls which are unrecognized or for which the user doesn't have the capability to focus (in which case it would no-op anyway). Also defers autofocus logic until instances are created, even after initial `ready` event. This ensures that autofocus can apply for any panels, sections, or controls that get created via the loaded preview.
See #28650.
Fixes#36018.
Built from https://develop.svn.wordpress.org/trunk@36796
git-svn-id: http://core.svn.wordpress.org/trunk@36763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Improves parity between partials and controls. A partial or control can be settingless if instantiated with `settings` param as empty array (otherwise, if null, then the partial/control ID is used).
* Eliminate need to create dummy settings that serve no purpose except to place a control in the UI.
* Removes dummy settings for `create_new_menu` and `new_menu_name`.
* Introduces `WP_Customize_Control::$capability` and `WP_Customize_Partial::$capability`, and if set checks them in the respective `check_capabilities()` methods.
* Prevents PHP fatal error from happening when non-existing settings are provided to control: "Call to a member function `check_capabilities()` on a non-object".
* Fixes issue where nav menu items and widgets were no longer working with selective refresh because cap check was failing.
See #27355.
Fixes#35926.
Built from https://develop.svn.wordpress.org/trunk@36689
git-svn-id: http://core.svn.wordpress.org/trunk@36656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces `WP_Customize_Manager::get_previewable_devices()` with a `customize_previewable_devices` filter to change the default device and which devices are available for previewing. This is a feature that was first pioneered on WordPress.com.
Props celloexpressions, folletto, valendesigns, westonruter, welcher, adamsilverstein, michaelarestad, Fab1en.
Fixes#31195.
Built from https://develop.svn.wordpress.org/trunk@36532
git-svn-id: http://core.svn.wordpress.org/trunk@36499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Introduce `WP_Customize_Manager::get_nonces()` to consolidate logic for retrieving nonces.
* Export nonces centrally in `wp.customize.settings.nonce` with each request and update nav menus preview to utilize.
* Send updated nonces to preview upon `nonce-refresh`.
* Request full preview refresh if Nav Menu selective refresh request fails (e.g. due to bad nonce).
* Update nav menus and widgets in Customizer to utilize `customize_refresh_nonces` for exporting nonces and keeping them up to date.
See #27355.
Fixes#35617.
Built from https://develop.svn.wordpress.org/trunk@36414
git-svn-id: http://core.svn.wordpress.org/trunk@36381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Ensure that Setting `Value` objects in preview get initial `_dirty` flag set if values among POST data.
* Upon `saved` event, send `saved` message to preview with the `response` to trigger `saved` event there.
* Reset `_dirty` flag for all setting `Value` objects in preview upon `saved`.
* Continue to create settings synced from pane even after initial bootstrap, and create them as dirty.
* Ensure that `id` property is set for setting `Value` objects in preview.
See #27355.
Fixes#35616.
Built from https://develop.svn.wordpress.org/trunk@36407
git-svn-id: http://core.svn.wordpress.org/trunk@36374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fixes a layout issue in the Customizer UI. Also de-duplicate title display logic, outputting "Loading..." as site title in PHP with actual title being set upon Customizer `ready`. Also update the site title in response to a `blogname` setting change as opposed to `input` DOM events on the control.
Fixes#35579.
Built from https://develop.svn.wordpress.org/trunk@36388
git-svn-id: http://core.svn.wordpress.org/trunk@36355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add missing `params.completeCallback` to `MenuItemControl.focus()` for parity with `Control.focus()`. Also adds `params` to `MenuItemControl.expandForm`, `MenuItemControl.collapseForm()`, and `MenuItemControl.toggleForm()`.
Props MattGeri, westonruter.
Fixes#32681.
Built from https://develop.svn.wordpress.org/trunk@36383
git-svn-id: http://core.svn.wordpress.org/trunk@36350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Widgets panel will not wait to display until the preview loads.
Also fixes problems with `margin-top` in panels where other panels' `active` states change, as well as ensuring sections of deactivated panel collapse before panel is hidden to prevent the pane from becoming empty of controls.
Fixes#33052.
Fixes#33567.
Built from https://develop.svn.wordpress.org/trunk@35231
git-svn-id: http://core.svn.wordpress.org/trunk@35197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The pre-3.4 theme previewer doesn't work when using a static front page.
We kept the old theme preview for no-JS and some browsers that were less capable. But since browsers are doing a better job today we don't need to continue fixing/shipping this legacy code. Bye!
fixes#33178.
Built from https://develop.svn.wordpress.org/trunk@33492
git-svn-id: http://core.svn.wordpress.org/trunk@33459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Monkey patches imgAreaSelect library to support touch events.
* Removes Settings version of Site Icon since it would have been the same flow.
* Removes default value for Customizer setting - there is no default favicon.
Fixes#16434.
Built from https://develop.svn.wordpress.org/trunk@33329
git-svn-id: http://core.svn.wordpress.org/trunk@33301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Move tabindex/focus code into `onChangeExpanded` so that it works for cases where `expand()` is called directly.
* Use `visibility: hidden` to hide hidden elements from keyboard focus and screen readers.
props celloexpressions.
fixes#31336.
Built from https://develop.svn.wordpress.org/trunk@33069
git-svn-id: http://core.svn.wordpress.org/trunk@33040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When changing the `page_on_front` setting (with `show_on_front`), change the previewed URL to be the home URL so that the effect can be seen. When changing `page_for_posts`, change the previewed URL to be the selected page.
Props valendesigns, westonruter.
Fixes#30677.
Built from https://develop.svn.wordpress.org/trunk@32976
git-svn-id: http://core.svn.wordpress.org/trunk@32947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `args.completeCallback` was not always called when `onChangeExpanded()` was called. And when a section became inactive (`active` state goes to `false`) and it was currently `expanded`, the Customizer panel would then becomes blank as the section was hidden; it needed to `collapse()` the section first before hiding the element.
See #31336.
Built from https://develop.svn.wordpress.org/trunk@32743
git-svn-id: http://core.svn.wordpress.org/trunk@32714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Always fall back to using the default template if no custom template exists.
* Provide a set of default params when constructing new `Section` and `Panel` objects.
Includes QUnit tests.
Props celloexpressions, westonruter, ocean90.
Fixes#30737.
Built from https://develop.svn.wordpress.org/trunk@32681
git-svn-id: http://core.svn.wordpress.org/trunk@32651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Headers are currently keyed by the basename of the image, see #31786. When two images have the same key only one image will be listed and the current image can be empty in the header control.
To prevent this we now fall back to the raw current header image if the image isn't in `_wpCustomizeHeader.uploads`.
props sirbrillig.
fixes#31742.
Built from https://develop.svn.wordpress.org/trunk@32091
git-svn-id: http://core.svn.wordpress.org/trunk@32070 1a063a9b-81f0-0310-95a4-ce76da25c4cd