Commit Graph

37762 Commits

Author SHA1 Message Date
Gary Pendergast 58fad5bf57 REST API: Add `permalink_structure` to the index endpoint.
This allows Gutenberg to implement permalink editing.

Props schlessera.
Fixes #42465.



git-svn-id: https://develop.svn.wordpress.org/trunk@42142 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 06:10:23 +00:00
Weston Ruter d7af48d421 Widgets: Style the Image Widget's link field as invalid when a bad URL is supplied.
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
2017-11-10 01:27:30 +00:00
Weston Ruter c994a2e9bb Customize: Fix reliability of just-in-time publishing for changesets that miss their schedule when visiting `customize.php`.
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
2017-11-09 04:43:09 +00:00
Weston Ruter d671098003 Customize: Ensure `autosaving` message gets sent to preview after initial change when `saved` state is first dirty.
Amends [41667].
Fixes #42475 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42136 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 04:14:46 +00:00
Weston Ruter ac5a3fc7a8 Settings: Fix date/time format previewing.
Props afercia.
Amends [41857].
Fixes #41603.


git-svn-id: https://develop.svn.wordpress.org/trunk@42134 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 03:54:13 +00:00
Weston Ruter 7a6ed11319 Customize: Restore search icon to available widgets pane incorrectly removed in [41893].
See #42215.
Fixes #42472 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42132 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-09 01:01:53 +00:00
Gary Pendergast 1c64182c6b Admin Bar: Fix another HTML error introduced in [42128].
Props Otto42.
See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42131 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-08 23:12:37 +00:00
Dion Hulse 56659638dc External Libraries: Update Random_Compat from 1.2.1 to 2.0.11.
Notably this fixes PHP7 parse errors of the files and removes the OpenSSL functionality.
Full Changes: https://github.com/paragonie/random_compat/compare/v1.2.1...v2.0.11

Props jrdelarosa.
See #42439.


git-svn-id: https://develop.svn.wordpress.org/trunk@42130 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-08 11:47:04 +00:00
Gary Pendergast e7d649e621 Admin Bar: Fix a HTML error introduced in [42128].
Props swissspidy.
See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42129 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-08 08:51:03 +00:00
Gary Pendergast e9282049e8 Admin Bar: Reformat the render methods.
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
2017-11-08 08:34:41 +00:00
Weston Ruter 9f77ec13ff Trunk is now 5.0-alpha
git-svn-id: https://develop.svn.wordpress.org/trunk@42127 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 05:46:41 +00:00
Weston Ruter ff6114f853 Post WordPress 4.9 RC2 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@42125 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 05:25:47 +00:00
Weston Ruter 6668ba7995 WordPress 4.9 RC2.
git-svn-id: https://develop.svn.wordpress.org/trunk@42124 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 04:53:36 +00:00
Konstantin Obenland 03136e1b23 About: Hardcoded image sources.
We're committed to these images now.

See #42087.


git-svn-id: https://develop.svn.wordpress.org/trunk@42123 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 04:25:26 +00:00
Weston Ruter a397b8f6bb Customize: Fix logic inversion in [42113] which prevented themes from being installed in Customizer.
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
2017-11-07 04:16:11 +00:00
Mel Choyce 6f8428e8b5 About Page: Implement design.
Props ryelle, karmatosed, transl8or, obenland, melchoyce.
See #42087.


git-svn-id: https://develop.svn.wordpress.org/trunk@42121 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-07 04:10:41 +00:00
Gary Pendergast 000809964a WPDB: Check that `AUTH_SALT` is not empty.
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
2017-11-07 01:08:11 +00:00
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