Simplify regular expression for checking URL validity to just do basic checks to confirm the value looks like a URL. Leave the complete validation to the server-side logic in `WP_Customize_Nav_Menu_Item_Setting::sanitize()` to avoid having to maintain two separate codebases for validating URLs.
Props westonruter, SergeyBiryukov for testing.
Amends [41697].
See #32816.
Fixes#42506 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42153 602fd350-edb4-49c9-b593-d223f7449a82
Fixes issue where a drafted/scheduled changeset could inadvertently re-use the previous autosave revision in the preview while a user expects it to have been dismissed.
See #39896, [41597].
Fixes#42502 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42144 602fd350-edb4-49c9-b593-d223f7449a82
Fixes issue where user may supply an invalid URL and be unable to save the widget on the Widgets admin screen without being told why.
Amends [41252].
See #41274.
Fixes#42488.
git-svn-id: https://develop.svn.wordpress.org/trunk@42140 602fd350-edb4-49c9-b593-d223f7449a82
When just doing `wp_publish_post()` for the changeset from `customize.php`, any option-based settings will fail to get saved because `WP_Customize_Manager` would have already been loaded with `settings_previewed`, resulting in `update_option()` calls being short-circuited. So an admin-ajax request to `customize_save` is used to work around this.
Props westonruter, jeremyfelt, dlh for testing, LittleBigThing for testing.
Amends [41626].
See #28721, #39221.
Fixes#42457 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@42138 602fd350-edb4-49c9-b593-d223f7449a82
The admin bar render methods use some cute tricks which don't come close to the WordPress coding standards. So that we can more easily apply automated code fixing to the codebase, these tricks need to be removed.
See #41057.
git-svn-id: https://develop.svn.wordpress.org/trunk@42128 602fd350-edb4-49c9-b593-d223f7449a82
Also fix PHP notice related to parent themes and WordPress.org theme query results.
Props dd32, obenland, celloexpressions, westonruter, atachibana for testing.
See #42406, #37661.
Fixes#42442.
git-svn-id: https://develop.svn.wordpress.org/trunk@42122 602fd350-edb4-49c9-b593-d223f7449a82
In `wpdb::placeholder_escape()`, the key for `hash_hmac()` defaults to `AUTH_SALT`, but `hash_hmac()` will return an empty string if the key is empty.
This had the side effect of the string `{}` being incorrectly replaced with a `%` character in queries just about to be run on the database.
Props jsonfry.
Fixes#42431.
git-svn-id: https://develop.svn.wordpress.org/trunk@42120 602fd350-edb4-49c9-b593-d223f7449a82
In `wpdb::placeholder_escape()`, the key for `hash_hmac()` falls back to `rand()` when `AUTH_SALT` is undefined. `hash_hmac()` requires the key to be a string, however, so we need to cast it as such.
Props mkomar.
Fixes#42401.
git-svn-id: https://develop.svn.wordpress.org/trunk@42119 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a bug where files couldn't be accessed in multisite installs.
Props flixos90, westonruter.
Fixes#42420.
git-svn-id: https://develop.svn.wordpress.org/trunk@42115 602fd350-edb4-49c9-b593-d223f7449a82
* Consider both `selectedChangesetStatus` and `changesetStatus` states when deciding to disable.
* Factor out common logic into `canSwitchTheme` function on `ThemesPanel`.
* Keep Live Preview and Install buttons disabled in Themes controls and detail overlays when appropriate.
Props westonruter, dlh.
Amends [41788].
See #42126, #37661, #39896.
Fixes#42406.
git-svn-id: https://develop.svn.wordpress.org/trunk@42113 602fd350-edb4-49c9-b593-d223f7449a82
Prevent edits to 2-level deep theme files from returning a `disallowed_theme_file` error when attempting to save an edit. Aligns logic for gathering `$allowed_files` in `theme-editor.php` for listing files with the validation logic in `wp_edit_theme_plugin_file()`.
Amends [41806].
See #6531.
Fixes#42425.
git-svn-id: https://develop.svn.wordpress.org/trunk@42112 602fd350-edb4-49c9-b593-d223f7449a82
Prevent user from having to re-enter the previously-supplied future date if they had switched from schedule to draft but wanted to switch back again. Improves parity with behavior of post edit screen.
Props dlh, westonruter, obenland.
See #39896, #28721.
Fixes#42413.
git-svn-id: https://develop.svn.wordpress.org/trunk@42109 602fd350-edb4-49c9-b593-d223f7449a82
* Also, updates POT files for Twenty Ten and Twenty Eleven.
Props lemacarl, maedahbatool, mrahmadawais, davidakennedy.
Fixes#42090.
git-svn-id: https://develop.svn.wordpress.org/trunk@42105 602fd350-edb4-49c9-b593-d223f7449a82
[41496] removed support for numbered placeholders in queries send through `wpdb::prepare()`, which, despite being undocumented, were quite commonly used.
This change restores support for numbered placeholders (as well as a subset of placeholder formatting), while also adding extra checks to ensure the correct number of arguments are being passed to `wpdb::prepare()`, given the number of placeholders.
See #41925.
git-svn-id: https://develop.svn.wordpress.org/trunk@42056 602fd350-edb4-49c9-b593-d223f7449a82
Prevent needlessly iterating over `controlConstructor` to find `type` when it is already supplied.
Amends [41750], [41726].
See #42083.
git-svn-id: https://develop.svn.wordpress.org/trunk@42048 602fd350-edb4-49c9-b593-d223f7449a82
Improve the logic determining which endpoints support the trash by enumerating them. Endpoints that don't support the trash require `force=true` when deleting. The previous approach relied on the `force` argument description, which is a translated string and was fragile. In the future, we can expose whether an endpoint supports the trash as part of its schema and automate this logic.
Props Soean.
Fixes#40672.
git-svn-id: https://develop.svn.wordpress.org/trunk@42047 602fd350-edb4-49c9-b593-d223f7449a82
Fixes UI bugs around theme updates in the Customizer. Theme versions now get updated and users are no longer left alone after a successful update.
Props rinkuyadav999, celloexpressions for initial patch.
Fixes#42365.
git-svn-id: https://develop.svn.wordpress.org/trunk@42046 602fd350-edb4-49c9-b593-d223f7449a82