Commit Graph

37695 Commits

Author SHA1 Message Date
Gary Pendergast f7fbbcba0d WPDB: Fix a PHP notice when `AUTH_SALT` is undefined.
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
2017-11-07 00:29:26 +00:00
Weston Ruter b23d590bf2 Customize: Prevent `customize_autosaved=on` from getting added to frontend preview URLs.
Amends [41969].
See #39896, #42450.
Fixes #42433.


git-svn-id: https://develop.svn.wordpress.org/trunk@42118 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-06 23:10:05 +00:00
Weston Ruter 2ae0f807ce 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42117 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-06 20:27:37 +00:00
John Blackbourn 7cc10e6ccb Administration: Ensure the new Privacy Policy screen appears when within the Network Admin and User Admin.
Props hnle, dd32
Fixes #42443


git-svn-id: https://develop.svn.wordpress.org/trunk@42116 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-06 18:16:25 +00:00
Konstantin Obenland a4f27c25bc File Editors: Account for network admin use
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
2017-11-03 18:50:43 +00:00
Weston Ruter 9976cd2b66 Customize: Ensure `changeset_uuid` param for autosave auto-draft gets stripped from location after previewing theme switch when not in branching mode.
Amends [41597].
See #39896.
Fixes #42415.


git-svn-id: https://develop.svn.wordpress.org/trunk@42114 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-03 17:36:27 +00:00
Weston Ruter c7cb694732 Customize: Make sure theme switch blocking in the Customizer is consistently applied when changeset is drafted/scheduled.
* 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
2017-11-03 00:58:25 +00:00
Weston Ruter 3fab757196 Theme Editor: Ensure files listed recursively can be both viewed and edited.
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
2017-11-02 23:04:54 +00:00
Weston Ruter 4f0527afdc 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42111 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 22:59:04 +00:00
Konstantin Obenland f0cb7b5696 Codemirror: Unify line endings in csslint.js
This is likely a problem caused upstream and will probably be a non-issue once #41870 is merged in a future release.

Fixes #42424.



git-svn-id: https://develop.svn.wordpress.org/trunk@42110 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 22:30:16 +00:00
Weston Ruter bdee44c461 Customize: Always use underlying changeset post date as initial date in scheduled date fields if date is future.
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
2017-11-02 19:59:55 +00:00
Weston Ruter 884fa6476e Customize: Prevent `history.replaceState()` and `history.pushState()` calls from causing error in customize preview before DOM ready.
Amends [41597].
See #39896.
Fixes #42414.


git-svn-id: https://develop.svn.wordpress.org/trunk@42108 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 19:26:23 +00:00
Weston Ruter dc3c350eab Customize: Prevent re-importing starter content when changeset is saved as draft or scheduled.
Themes cannot currently be switched in Customizer after changeset is saved anyway.

Props dlh, westonruter.
See #40146, #42411, #42126.
Fixes #42395.


git-svn-id: https://develop.svn.wordpress.org/trunk@42107 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 18:59:40 +00:00
Weston Ruter d6aece2a33 Bundled Themes: Fix fragile `update-theme` phpunit test which broke after version updates in [42105].
See #42090.


git-svn-id: https://develop.svn.wordpress.org/trunk@42106 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-02 01:25:57 +00:00
David A. Kennedy ec2b0be9a6 Bundled Themes: Bump version numbers and update changelogs for 4.9 release
* 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
2017-11-01 22:42:50 +00:00
Weston Ruter 7b33220fa3 Customize: Strip zero padding when setting month to prevent de-selection; add zero-padding for `number` input fields when blurring.
Amends [42042].
See #42373.
Fixes #42392.


git-svn-id: https://develop.svn.wordpress.org/trunk@42104 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-01 21:03:36 +00:00
Gary Pendergast a39d599adf Database: Restore numbered placeholders in `wpdb::prepare()`.
[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
2017-10-31 11:59:43 +00:00
westonruter 15f74e83fa Post WordPress 4.9 RC1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@42050 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 04:31:03 +00:00
Weston Ruter 53af23a241 WordPress 4.9 RC1.
git-svn-id: https://develop.svn.wordpress.org/trunk@42049 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 03:41:16 +00:00
Weston Ruter 00eb9473b2 Customize: Consolidate sourcing of control `params`.
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
2017-10-31 02:58:42 +00:00
Adam Silverstein 0a964a48f8 REST API: JS client - Enumerate endpoints supporting trash.
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
2017-10-31 02:53:44 +00:00
Konstantin Obenland f19d308ece Customize: Spiff up theme updates
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
2017-10-31 01:32:15 +00:00
Gary Pendergast 2c0031b21d About page: Tweak the privacy policy language, for clarity.
See #40794.



git-svn-id: https://develop.svn.wordpress.org/trunk@42045 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-31 00:20:58 +00:00
Mel Choyce a3ca329182 About Page: Update the blurb in "Warning: Potential Danger Ahead!" to be more accurate.
Props transl8or, karmatosed, chanthaboune.
See #42087.


git-svn-id: https://develop.svn.wordpress.org/trunk@42044 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-30 20:57:54 +00:00
Felix Arntz 43396e2b42 Multisite: Pass network object instead of ID to `pre_get_main_site_id`.
In the original function introduced in [41380], and subsequently [41861], only the network ID was passed to the new `pre_get_main_site_id` filter. In order to make give quick access to other network properties, it was decided to pass the whole object instead. The changeset includes an additional test.

Fixes #29684.


git-svn-id: https://develop.svn.wordpress.org/trunk@42043 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-30 19:55:09 +00:00
Weston Ruter 8f661ef667 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42042 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-30 16:39:06 +00:00
Weston Ruter a9405baf66 Tests: Remove references to deleted JS files in QUnit tests.
Amends [41570], [40584].
See #41755, #40690.


git-svn-id: https://develop.svn.wordpress.org/trunk@42041 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-30 04:05:20 +00:00
Weston Ruter 9461f57532 Customize: Debounce requests for theme searches and the updating of the resulting filter count.
Props celloexpressions.
See #37661.
Fixes #42343.


git-svn-id: https://develop.svn.wordpress.org/trunk@42040 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-30 03:56:26 +00:00
Weston Ruter 8f0dbb4f43 Customize: Fix phpdoc for params in `WP_Customize_Manager::add_section()`.
Amends [40804].
See #39671.
Fixes #42372.


git-svn-id: https://develop.svn.wordpress.org/trunk@42039 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-29 03:21:27 +00:00
Weston Ruter 3c7bf038d8 Customize: Fix interface alignment between `Setting` and `Control`, adding `defaults` to `wp.customize.Setting` and using `wp.customize.previewer` as default `previewer` param.
Also move jsdoc from class to `initialize` method and correct the param types.

Amends [41726], [42037], [32681].
See #42083, #30737.


git-svn-id: https://develop.svn.wordpress.org/trunk@42038 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-29 03:07:30 +00:00
Weston Ruter 9368a2efa8 Customize: Support instantiation of partials with flat/unwrapped params for parity with controls, sections, and panels in [41726].
* Passing `options.params` when constructing `Partial` is now deprecated in favor of just passing `options`.
* Improve usage of jsdoc in JS `Partial` class.
* Also add `defaults` property to `wp.customize.selectiveRefresh.Partial` class for parity with `Control`.

See #42083.


git-svn-id: https://develop.svn.wordpress.org/trunk@42037 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-29 00:14:06 +00:00
Weston Ruter 69b8d057da Customize: Fix mobile placement of panes for available widgets and nav menu items.
Props Mahvash-Fatima.
Amends [41893].
See #42215.
Fixes #42359.


git-svn-id: https://develop.svn.wordpress.org/trunk@42036 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-28 06:53:40 +00:00
Weston Ruter f9472e94b8 Customize: Ensure `id` for section and panel is passed among `params` to respective templates.
Fixes issue where JS-added Publish Settings section failed to get container element ID set properly to hide its section-meta.

Amends [42025].
See #42337, #42083.


git-svn-id: https://develop.svn.wordpress.org/trunk@42035 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-28 06:36:12 +00:00
Weston Ruter 01bb1fd6cb 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42034 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-28 05:47:06 +00:00
Weston Ruter d1e1b9bf24 Customize: Fix deep-linking to sections for themes via `autofocus[section]` query parameter.
* Expand containing panel when expanding themes section.
* Consolidate UI changes related to a section's expanded state change.
* Prevent collapsing current section when expanding.
* Auto-expand first themes section when expanding panel if one is not expanded already.

See #37661, #42354.
Fixes #42360.


git-svn-id: https://develop.svn.wordpress.org/trunk@42033 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-28 05:21:42 +00:00
Gary Pendergast 698747975a Tests: Update `wp-api-generated.js`.
[41979] caused a change in `wp-api-generated.js`, so it needs to be updated.

See #39996.



git-svn-id: https://develop.svn.wordpress.org/trunk@42032 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-28 01:56:00 +00:00
Weston Ruter acd03e1ecb 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42031 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-27 20:17:49 +00:00
Weston Ruter 6eacf2f06b Widgets: Prevent showing underlying attachment excerpt as caption when empty caption value is supplied in Image widget.
Allow underlying attachment to display if `caption` is `null`.

Props miyauchi, westonruter.
See #39993.
Fixes #42350.


git-svn-id: https://develop.svn.wordpress.org/trunk@42030 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-27 05:04:04 +00:00
Weston Ruter 49ec33ae71 Themes: Switch back from throttling to debouncing in theme searches on admin screen.
Start debouncing after initial search performed when `search` query param is present to prevent initial "flash of unsearched themes".

Props afercia, westonruter.
Amends [41797].
See #40254.
Fixes #42348.


git-svn-id: https://develop.svn.wordpress.org/trunk@42029 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-27 03:30:27 +00:00
John Blackbourn afa1b06984 External Libraries: Remove usage of `each()` from the `Text_Diff_Engine_native` class.
This removes deprecated notices in PHP 7.2 but takes a different approach to the upstream class from Horde, which appears to be buggy.

Props SergeyBiryukov
Fixes #41526


git-svn-id: https://develop.svn.wordpress.org/trunk@42028 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-26 12:51:51 +00:00
John Blackbourn 54602b9904 External Libraries: Remove usage of text strings in `assert()` in the `Text_Diff_Engine_native` class.
See #41526


git-svn-id: https://develop.svn.wordpress.org/trunk@42027 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-26 11:31:20 +00:00
Konstantin Obenland 2ddcc549d2 Menus: Add `menu-$i` slugs to mapping groups
Helps to future proof the feature.
Also orders slugs by popularity to optimize mapping time.

See #39692.


git-svn-id: https://develop.svn.wordpress.org/trunk@42026 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 22:28:43 +00:00
Weston Ruter 6f5777ecbf Customize: Register the Publish Settings section in JS to ensure it does not get unregistered via PHP.
The `publish_settings` section is a fundamental dependency for Customizer, so it must be guaranteed to be registered.

Also unconditionally register core types for panels, sections, and controls in case plugin unhooks all `customize_register` actions.

See #39896.
Fixes #42337.


git-svn-id: https://develop.svn.wordpress.org/trunk@42025 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 21:44:48 +00:00
Weston Ruter 610b1f05de Customize: Link `elements` prior to embedding to prevent possible errors when a control is associated with a non-existent section.
Fixes issue specifically with attempting to access an orphaned control's `elements` immediately after it has been added. Normally this would not happen because a control would not be registered without a section, and also a control should only be interacted with once its `embedded` deferred has been resolved.

Also harden logic for gathering list of deferred setting IDs.

See #37964.
Fixes #42330.


git-svn-id: https://develop.svn.wordpress.org/trunk@42024 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 16:48:19 +00:00
Sergey Biryukov a33d615433 Permalinks: Change mention of URI to URL in the description of `%category%` tag.
Props danieltj, tobifjellner.
Fixes #42147.

git-svn-id: https://develop.svn.wordpress.org/trunk@42023 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 11:10:12 +00:00
John Blackbourn 3a3f3c435d External Libraries: Revert [41633]. This causes warnings when editing and viewing certain revisions.
See #41526


git-svn-id: https://develop.svn.wordpress.org/trunk@42022 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 09:55:39 +00:00
Weston Ruter a05bfe001c Post WordPress 4.9 Beta 4 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@42021 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 07:07:07 +00:00
Weston Ruter add4294ca6 WordPress 4.9 Beta 4.
git-svn-id: https://develop.svn.wordpress.org/trunk@42020 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 06:12:26 +00:00
David A. Kennedy 5a7f9c48b1 Bundled Themes: Make sure new gallery widgets look good in themes
Twenty Ten: Reduces image size and removes image borders for galleries in widget areas.
Twenty Eleven: Reduces image size and removes image borders for galleries in widget areas.
Twenty Twelve: Reduces image size for some gallery sizes in widget areas.
Twenty Thirteen: Ensure proper clearing for images, hide captions for some gallery column combos and ensure good display for galleries in widget areas.
Twenty Fourteen: Ensure proper clearing for images and hide captions for some gallery column combos for galleries in widget areas.
Twenty Seventeen: Hide captions for some gallery column combos for galleries in widget areas.

Props joyously, williampatton, davidakennedy, melchoyce, crunnells.

Fixes #41969.


git-svn-id: https://develop.svn.wordpress.org/trunk@42019 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 02:16:39 +00:00
Weston Ruter 273e0e8ecc Customize: Remove `theme_installing` notification when installation fails.
Amends [41648].
Props celloexpressions.
See #42184, #37661.


git-svn-id: https://develop.svn.wordpress.org/trunk@42018 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 01:13:09 +00:00