Commit Graph

5472 Commits

Author SHA1 Message Date
Weston Ruter 48980cd541 About: Synchronize 4.9 tagline across about pages for credits, freedoms, and privacy.
Props dave.pullig.
Amends [41943].
See #42087.
Fixes #42518 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42157 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-12 19:58:13 +00:00
Weston Ruter 64a9b85f77 Theme Editor: Fix styling of child theme notice.
Props westonruter, melchoyce, ndiego.
See #24048.
Fixes #42491 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42155 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-11 20:42:04 +00:00
Weston Ruter 138ffd49a9 Customize: Restore ability to add Custom Link nav menu items for jump links and other URLs that were previously allowed.
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
2017-11-10 23:40:41 +00:00
Weston Ruter b4c66ad91b Customize: Prevent nav menu location assignment checkbox change from increasing height by 1px.
Props obenland.
Amends [41817].
See #42157.
Fixes #42492.


git-svn-id: https://develop.svn.wordpress.org/trunk@42152 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 23:00:21 +00:00
John Blackbourn fc40dea2fd Docs: Correct parameter type documentation for various `__call()` methods.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42151 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:56:01 +00:00
Weston Ruter f42f19e1c5 Customize: Improve accuracy of message displayed when accessing Customizer with a changeset that is already published or trashed.
Amends [38810].
Props dlh.
Fixes #42497.


git-svn-id: https://develop.svn.wordpress.org/trunk@42150 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:50:49 +00:00
Weston Ruter 08a3691775 Settings: Replace `count()` call with `empty()` in `get_settings_errors()` to prevent PHP 7.2 warnings when `$wp_settings_errors` is `null`.
Props pross, dd32, westonruter.
See #40109.
Fixes #42498 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42146 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-10 22:29:45 +00:00
Weston Ruter 89bea84d6e Customize: Ensure autosave revision is dismissed immediately after implicit restoration notice dismissal as done with explicit notice dismissal.
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
2017-11-10 21:43:32 +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
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
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
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
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
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
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
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 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 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
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 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
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
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
Gary Pendergast fdc3e41085 About page: The link URLs in the privacy policy shouldn't be translatable.
Both of these URLs live on the main wordpress.org site, not Rosetta sites.

See #40794.



git-svn-id: https://develop.svn.wordpress.org/trunk@42017 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 01:06:19 +00:00
Ian Dunn cac531f50b Dashboard: Strip ports from IPs to avoid PHP warnings.
Fixes #41083.
Props pento, iandunn, EatonZ, birgire, dd32.


git-svn-id: https://develop.svn.wordpress.org/trunk@42016 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 00:06:06 +00:00
Weston Ruter 88497dc5d5 Update `$_old_files` to add the deleted MediaElement.js files when it was upgraded from 2.22.0 to 4.2.3.
Amends [41198].
See #39686.
Fixes #42097.


git-svn-id: https://develop.svn.wordpress.org/trunk@42015 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-25 00:01:29 +00:00
Sergey Biryukov 3ef1cabd1e I18N: Use a consistent pattern for translator comments for placeholders in the string added in [42013].
See #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@42014 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:39:48 +00:00
Mel Choyce 7201576757 Code Editors: Add a persistent notification on CSS files, encouraging people to use the CSS panel in the Customizer instead of editing their CSS files directly.
Props helen, westonruter, nic.bertino, michelleweber.
Fixes #42100.


git-svn-id: https://develop.svn.wordpress.org/trunk@42013 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:34:31 +00:00
Weston Ruter 2d249b2535 Permalinks: Fix placement of structure tags based on last cursor position.
Props felipeelia, afercia.
See #29872.
Fixes #42042.


git-svn-id: https://develop.svn.wordpress.org/trunk@42012 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:26:38 +00:00
John Blackbourn 3e9a42ed27 Filesystem API: Add more specificity to the rules for valid files in `validate_file()`.
This now treats files containing `./` as valid, and also treats files containing a trailing `../` as valid due to widespread use of this pattern in theme and plugin zip files.

Adds tests.

Props Ipstenu, borgesbruno, DavidAnderson, philipjohn, birgire
Fixes #42016, #36170


git-svn-id: https://develop.svn.wordpress.org/trunk@42011 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:14:33 +00:00
John Blackbourn 49b7cb458f Filesystem API: Don't immediately return an error for invalid file names contained within a Zip while it's being extracted.
This allows the extraction of the rest of the valid files within the archive to continue.

See #42016


git-svn-id: https://develop.svn.wordpress.org/trunk@42010 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:10:37 +00:00
Weston Ruter 18a231bad6 Embeds: Improve consistency of update and refresh logic for oEmbed caching between `oembed_cache` and post meta.
* Allow updating oEmbed cache during `parse-embed` requests for non-post editors (such as widgets).
* Update any existing `oembed_cache` post when `usecache` and TTL has passed.
* Do not overwrite a previously valid cache with `{{unknown}}`.

Props dlh.
See #34115.
Fixes #42310.


git-svn-id: https://develop.svn.wordpress.org/trunk@42009 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:09:43 +00:00
Sergey Biryukov 8d56eff073 Transients: After [41963], add missing cron task for `delete_expired_transients()`.
Props dlh.
Fixes #41699.

git-svn-id: https://develop.svn.wordpress.org/trunk@42008 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 23:00:01 +00:00
John Blackbourn 7329816301 Docs: Improve the docs for `validate_file()` and `validate_file_to_edit()`.
See #42016, #36170, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@42007 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 22:49:13 +00:00
Sergey Biryukov 80fd300ebf I18N: Use a consistent pattern for translator comments for placeholders in some more Customizer strings.
See #41974.

git-svn-id: https://develop.svn.wordpress.org/trunk@42006 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 22:46:27 +00:00
Sergey Biryukov 6768a2cd2a I18N: Add a context for remaining "Schedule" strings.
Props Mirucon.
Fixes #42165.

git-svn-id: https://develop.svn.wordpress.org/trunk@42005 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 22:34:05 +00:00
Weston Ruter e28dfcd584 Themes: Harmonize list of theme features on Theme Install screen with list in the Customizer.
Use the core list, rather than the .org API, due to inconsistencies and to ensure tags are translated.

Props celloexpressions.
See #37661, #42306.


git-svn-id: https://develop.svn.wordpress.org/trunk@42003 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 21:45:14 +00:00
Mel Choyce 36f253d1d9 Code Editors: Tweak styles to work better on smaller screens.
See #42100.


git-svn-id: https://develop.svn.wordpress.org/trunk@41999 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 20:29:00 +00:00
Mel Choyce f06055cf90 Credits: Update "Contributing Developers" to "Noteworthy Contributors."
"Developers" excludes the various major contributors in non-developer roles, so let's update this term to be more inclusive.

See #41022.


git-svn-id: https://develop.svn.wordpress.org/trunk@41998 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 19:28:43 +00:00
Weston Ruter 2b64083fba Customize: Prevent theme installation and deletion in Customizer while SFTP credentials need to be requested.
This is a temporary measure while we wait for credentials to be able to be supplied in the Customizer.

Amends [41788].
See #42184, #37661, #42126.


git-svn-id: https://develop.svn.wordpress.org/trunk@41997 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 19:05:48 +00:00
Mel Choyce dbafaf152a Code Editors: Update copy in warning modals.
Props helen.
See #42100.


git-svn-id: https://develop.svn.wordpress.org/trunk@41996 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 18:46:26 +00:00
Weston Ruter c0a61efdad Code Editor: Define default `gutters` and toggle lint markers based on changes to `lint` option.
Explicitly define `gutters` in base `defaultSettings` to improve merges of multiple calls to `wp_enqueue_code_editor()`.

Props westonruter, georgestephanis for testing.
Amends [41974].
See #12423.


git-svn-id: https://develop.svn.wordpress.org/trunk@41992 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 16:34:12 +00:00
Sergey Biryukov 92d8a1799e Taxonomy: Use `keypress` instead of `keyup` for listening for Enter key to add a tag via Tags meta box.
Fixes issue with Japanese input.

Props miyauchi.
Fixes #42234.

git-svn-id: https://develop.svn.wordpress.org/trunk@41988 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 11:29:34 +00:00
Sergey Biryukov eac206b375 Taxonomy: After [40984], add the `most_used` label for non-hierarchical taxonomies too, and use it on the Menus screen.
Props johnbillion.
Fixes #41150.

git-svn-id: https://develop.svn.wordpress.org/trunk@41987 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 11:21:47 +00:00
Sergey Biryukov 08421dfc72 I18N: Remove `<code>` and `<kbd>` tags from translatable strings on Settings screens.
Move URLs to separate strings.

Props ramiy.
Fixes #40763.

git-svn-id: https://develop.svn.wordpress.org/trunk@41986 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 10:50:40 +00:00
Weston Ruter ac68181c94 Editor: Specify `maxwidth` in `parse-embed` requests based on width of editor iframe so that TinyMCE view embeds fit, particularly in Text widgets.
See #40854, #34115.


git-svn-id: https://develop.svn.wordpress.org/trunk@41985 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 04:06:23 +00:00
Helen Hou-Sandi ace979586b Buttons: Ensure active styling applies to both `:active` and `.active`.
props sayedwp, helen.
fixes #42236.


git-svn-id: https://develop.svn.wordpress.org/trunk@41984 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 23:33:54 +00:00
Mel Choyce 5a4a469bc2 About Page: Revised strings to be easier to translate.
Props kristastevens, Presskopp, swissspidy.
See #42087.


git-svn-id: https://develop.svn.wordpress.org/trunk@41981 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 22:23:35 +00:00
Peter Wilson 733a81d74d Comments: Check if `wp_new_comment()` returns an error.
Adds checks throughout to allow for `wp_new_comment()` returning a `WP_Error` instance.

Updates the docs for the `pre_comment_approved` filter to include that it can be passed an error.

Props enrico.sorcinelli, ryotsun.
Fixes #39730.



git-svn-id: https://develop.svn.wordpress.org/trunk@41980 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 22:11:11 +00:00
Aaron Jorbin 074009ecdb Dashboard: Remove "Try Gutenberg" callout.
Reverting this for 4.9. It will be added back in a future version of WordPress. This doesn't mean that you shouldn't be trying Gutenberg, just that it isn't ready for a call out to a larger audience. But if you are the type to read commit messages, https://github.com/WordPress/gutenberg could use your pull requests and comments on issues.

Reverts [41931] [41900] [41896] [41895]
See #41316



git-svn-id: https://develop.svn.wordpress.org/trunk@41978 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 20:47:27 +00:00
Weston Ruter 852174ad7f Code Editor: Keep linting and its error reporting configured when `lint` option is changed dynamically.
Also explicitly disable `lint` option for SCSS and LESS.

See #12423.


git-svn-id: https://develop.svn.wordpress.org/trunk@41974 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 19:54:33 +00:00
Andrea Fercia 9dc63e7cab Customize: Make sure the FTP credentials modal is visible.
The customizer and the theme installer use `visibility: hidden` on the body when
they open full-overlays screens. The FTP credentials modal needs a visibility
property set back to `visible` to be visible over those overlays.

Props purnendu.
Fixes #42205.


git-svn-id: https://develop.svn.wordpress.org/trunk@41972 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 17:53:36 +00:00
Weston Ruter 3bcd5075f5 Customize: Keep frontend preview link updated to reflect the current state of previewed URL, active theme, and autosaved state.
See #39896.


git-svn-id: https://develop.svn.wordpress.org/trunk@41969 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 00:40:05 +00:00
Weston Ruter e06f346a2c Customize: Update 'Save & Activate' reference to 'Publish & Activate' in themes help tab text.
See #39896.
Fixes #42305.


git-svn-id: https://develop.svn.wordpress.org/trunk@41968 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-22 20:02:26 +00:00
Gary Pendergast 4670c8f3af Media: Don't backdate media uploaded to pages.
When media is uploaded to a post, the upload directory is set according to the date of the post, so that the media URLs in the post match when the post was published.

A page is a slightly different beast, pages often live for years, and are regularly updated to stay relevant. This change causes media uploaded to pages to use the upload date to determine the upload directory.

Fixes #10752.



git-svn-id: https://develop.svn.wordpress.org/trunk@41964 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 13:26:24 +00:00
Dion Hulse 899fb2f7f6 Transients: Clear expired transients from the database in a daily cron task.
Fixes #41699


git-svn-id: https://develop.svn.wordpress.org/trunk@41963 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 13:21:24 +00:00
Weston Ruter dbfb9f0f0b Customize: Improve back-compat for `wp.customize.Control` subclasses that expect `options.params` to be present for direct manipulation before calling parent `initialize` method.
Fixes known incompatibility with Make theme.

Amends [41726].
See #30741.


git-svn-id: https://develop.svn.wordpress.org/trunk@41961 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 08:50:43 +00:00
Weston Ruter 931bcb0f7d Customize: Allow control subclasses to add to the `deferred` object before the base class initializes.
Update the `CodeEditorControl`'s `codemirror` deferred to be set before calling the parent class's `initialize` method. Since the `ready` method may be called directly by `initialize` it may be too late to add a new `Deferred` to the control's `deferred` property after calling the base control class's `initialize`.

Amends [41958].
See #41897.


git-svn-id: https://develop.svn.wordpress.org/trunk@41960 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 08:43:36 +00:00
Weston Ruter c8c16b9f70 Customize: Add `codemirror` deferred object to `CodeEditorControl` which is resolved when CodeMirror is initialized.
CodeMirror gets initialized once the control's containing section is expanded. The deferred will be rejected if user preference for syntax highlighting is disabled.
Also move jsdoc from `wp.customize.Control` to intended `wp.customize.Control#initialize()`.

See #41897, #12423.


git-svn-id: https://develop.svn.wordpress.org/trunk@41958 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 21:47:13 +00:00
Weston Ruter f5534ec8d5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@41957 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 16:38:35 +00:00
Weston Ruter 620eb3052c Customize: Prevent using default template for a base control when it has content rendered on the server.
Also prevent invalid `type` attribute from being added to a `select` element.

See #30738.
Fixes #42286.


git-svn-id: https://develop.svn.wordpress.org/trunk@41952 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 03:29:30 +00:00
Weston Ruter d204ba3c00 Widgets: Improve extensibility of the Gallery widget and of media widgets generally.
* Introduce a `widget_{$id_base}_instance_schema` filter for plugins to add new properties to a media widget's instance schema.
* Pass all of a gallery widget's instance props to the gallery media frame, not just the ones that core supports.

See #32417, #41914.
Fixes #42285.


git-svn-id: https://develop.svn.wordpress.org/trunk@41951 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 23:43:22 +00:00
Weston Ruter 8206a9d225 Customize: Prevent re-highlighting "Add Items" button after available nav menu items pane has already been opened.
Amends [41930].
Props bpayton.
See #42114.


git-svn-id: https://develop.svn.wordpress.org/trunk@41950 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 18:37:10 +00:00
Weston Ruter 4238b2895f Customize: Fix alignment of Customize, Activate, and Live Preview buttons appearing on the Themes admin screen.
Amends [41893].
Props Mahvash-Fatima.
See #42215.
Fixes #42275.


git-svn-id: https://develop.svn.wordpress.org/trunk@41949 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 18:09:16 +00:00
Weston Ruter 253c7f03cc Customize: Fix rendering issues in theme browsing when opening theme details or performing search in Safari.
Props sayedwp.
See #37661.
Fixes #42052.


git-svn-id: https://develop.svn.wordpress.org/trunk@41948 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 17:56:56 +00:00
Weston Ruter d15347ae52 Customize: Prevent drawing attention to save button if status unchanged from publish; account for changes to status/date when alerting about unsaved changes.
Also fix malformed ESLint directive from [41933].

Amends [41932].
See #39896, #42211.


git-svn-id: https://develop.svn.wordpress.org/trunk@41947 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 17:41:05 +00:00
Gary Pendergast b4ede0319c About page: Update the privacy policy dashes.
If one were to insert 1—3 dashes into a sentence - on purpose - they should use the correct da–
sh.

See #40794.



git-svn-id: https://develop.svn.wordpress.org/trunk@41946 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 15:35:47 +00:00
Gary Pendergast 3507f4798f About page: Update the privacy policy language.
See #40794.



git-svn-id: https://develop.svn.wordpress.org/trunk@41944 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 15:25:54 +00:00
Mel Choyce 61c11a54d3 About Page: Commit initial strings for 4.9.
Props kristastevens, dd32, hlashbrooke.
See #42087.


git-svn-id: https://develop.svn.wordpress.org/trunk@41943 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 13:56:36 +00:00
Sergey Biryukov e18b4c894b Menus: Pass `$recent_args` parameter to `nav_menu_items_{$post_type_name}_recent` filter.
Props welcher, eclev91.
Fixes #39849.

git-svn-id: https://develop.svn.wordpress.org/trunk@41941 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 13:04:28 +00:00
Joe McGill 2cce6bb55a Customizer: Improve handling of crops in the media library.
This is a follow up on r41732, implementing the following improvements:

* Attachment parent info is now stored in attachment meta rather than a 
separate post meta key.
* Attachments created from contextual crops (e.g. header, logos, etc.) are
filtered out of the media library using a new `_filterContext` method in
`wp.media.controller.Library`.

Props joemcgill, westonruter.
See #21819.


git-svn-id: https://develop.svn.wordpress.org/trunk@41937 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 04:17:31 +00:00
Weston Ruter aac833887e Customize: Consistently use `input_attrs` as control param key in JS instead of `inputAttrs`.
See #30738, #41897.


git-svn-id: https://develop.svn.wordpress.org/trunk@41936 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 03:24:20 +00:00
Weston Ruter 1c04006909 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@41935 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 03:03:19 +00:00
Sergey Biryukov b1f20b6763 I18N: Unify permission error message in `wp-admin/ms-delete-site.php`.
Props ramiy.
Fixes #42268.

git-svn-id: https://develop.svn.wordpress.org/trunk@41934 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 00:47:15 +00:00
Weston Ruter 0421a2b0a4 Widgets: Harden logic for checking for valid media URLs.
* Update deprecated `isHostedVideo` method to always return `true` since all oEmbeds are now supported.
* Disable `scanImage` for non-image media widgets.
* Ensure embed URL field element is matched from current media frame instance due to bug where media frames are not destroyed upon closing.
* Update error message for invalid video URLs to ask user to check the URL for validity.

Props gk.loveweb, octalmage, westonruter.
See #42039, #40935.
Fixes #41052.


git-svn-id: https://develop.svn.wordpress.org/trunk@41933 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-19 00:06:25 +00:00
westonruter 285be53824 Customize: Draw attention to save button after collapsing the publish settings section when the changeset status or date had been changed.
Props bpayton, westonruter.
See #42114, #39896.
Fixes #42211.


git-svn-id: https://develop.svn.wordpress.org/trunk@41932 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 23:05:02 +00:00
Sergey Biryukov 3ce1938687 Dashboard: Add missing URL to "Help with testing" link in Gutenberg callout.
See #41316.

git-svn-id: https://develop.svn.wordpress.org/trunk@41931 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 22:40:42 +00:00
Weston Ruter 1c521e35c5 Customize: Draw attention to "Add Items" button after creating a new menu.
Introduce `wp.customize.utils.highlightButton()` and `wp.customize.Menus.MenuSection#highlightNewItemButton()`.

Props bpayton, melchoyce, afercia, westonruter.
Fixes #42114.


git-svn-id: https://develop.svn.wordpress.org/trunk@41930 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 21:59:34 +00:00
Sergey Biryukov 40706838a1 Rewrite Rules: Remove redundant `if` condition in `extract_from_markers()`.
Props Dency, yahil, appchecker.
Fixes #39920.

git-svn-id: https://develop.svn.wordpress.org/trunk@41928 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 21:27:22 +00:00
Sergey Biryukov ac8bc46b09 Administration: After [41120], check for a registered action before sending a Bad Request HTTP response status code.
Props Clorith.
Fixes #42240.

git-svn-id: https://develop.svn.wordpress.org/trunk@41926 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 21:00:39 +00:00
Sergey Biryukov adfa4cd450 Menus: Remove unnecessary top margin for menu item type on Menus screen for correct alignment with the dropdown icon.
Props punit5658.
Fixes #41521.

git-svn-id: https://develop.svn.wordpress.org/trunk@41925 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-18 20:51:23 +00:00