Commit Graph

37678 Commits

Author SHA1 Message Date
Joe Hoyle fb2e44456e REST API: Don’t remove unregistered properties from objects in schema.
In r41727 the ability to sanitise and validate objects from JSON schema was added, with a whitelist approach. It was decided we should pass through all non-registered properties to reflect the behaviour of the root object in register_rest_route. To prevent arbitrary extra data via setting objects, we force additionalProperties to false in the settings endpoint.

See #38583.

git-svn-id: https://develop.svn.wordpress.org/trunk@42000 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 21:04:50 +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
Konstantin Obenland 619f0b4b34 Customize: Allow previewed menus to be customized
Fixes a bug where menu assignements couldn't be changed when previewing a theme.
Also removes an unnecessary call to menu mapping after a theme switch from the customizer and makes sure the locations option is always written, for good measure.

Props westonruter.
See #39692.


git-svn-id: https://develop.svn.wordpress.org/trunk@41995 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 18:34:21 +00:00
Weston Ruter a411d5571a Code Editor: Fix phpunit tests related to `gutters` after [41974].
See #12423.


git-svn-id: https://develop.svn.wordpress.org/trunk@41994 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 16:57:10 +00:00
Ella Van Dorpe 7ddfa7c135 TinyMCE: Set undefined FloatPanel zIndex
See [40995] for the Customizer.
Fixes #42322.



git-svn-id: https://develop.svn.wordpress.org/trunk@41993 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 16:51:50 +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 18f91933fb Canonical: Strip trailing punctuation from permalinks.
Previously attempted in [40256], which caused the test for decoded curly quotes to fail in some environments.

`$_SERVER['REQUEST_URI']` contains the encoded URI, so this version removes the failing tests and only checks for encoded curly quotes.

Props joostdevalk, lancewillett, SergeyBiryukov.
Fixes #20383.

git-svn-id: https://develop.svn.wordpress.org/trunk@41991 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 14:17:22 +00:00
Sergey Biryukov b36ed916e8 Formatting: Make sure `wp_allowed_protocols()` is filterable until `wp_loaded` has fired.
Fixes the issue with plugins not being able to use the `kses_allowed_protocols` filter if `esc_url()` was called too early.

Props turtlepod, SergeyBiryukov.
Fixes #36033.

git-svn-id: https://develop.svn.wordpress.org/trunk@41990 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 13:24:43 +00:00
John Blackbourn 4b6528e760 Docs: Correct a class name in the docs for `WP_Customize_Manager::post_value()`.
See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41989 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-24 11:56:32 +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
Sergey Biryukov 0e87ef42d0 Docs: Fix typo in `path_is_absolute()` description.
Props octalmage, birgire.
Fixes #42317.

git-svn-id: https://develop.svn.wordpress.org/trunk@41983 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 22:50:30 +00:00
westonruter d5e4547ef9 Menus: Don't prime nav menu items cache if a persistent cache is being used.
Amends [14560].
Props david.binda.
See #12734.
Fixes #41662.


git-svn-id: https://develop.svn.wordpress.org/trunk@41982 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 22:39:02 +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
Weston Ruter a0910276f1 REST API: Allow passing existing template value for posts even when template no longer exists.
Also remove `enum` for validating allowed templates to allow plugins to dynamically supply their own templates for specific posts, even when they are not in the theme.

Props TimothyBlynJacobs, jnylen0, swissspidy.
Fixes #39996.


git-svn-id: https://develop.svn.wordpress.org/trunk@41979 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 22:10:48 +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 a719234281 Code Editor: Add `underscore` as a dependency for the `code-editor` script.
Amends [41376].
See #12423.


git-svn-id: https://develop.svn.wordpress.org/trunk@41977 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 20:37:22 +00:00
Pascal Birchler af799224b7 Themes: Add files missed in [41975].
See #41717.


git-svn-id: https://develop.svn.wordpress.org/trunk@41976 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 20:22:44 +00:00
Pascal Birchler 87d77bc24a Themes: Show templates from both parent and child theme when calling `WP_Theme::get_post_templates()`.
Props birgire for initial patch.
Fixes #41717.


git-svn-id: https://develop.svn.wordpress.org/trunk@41975 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 20:07:06 +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
Konstantin Obenland fbf27f0c23 Customize: Ease extendability of filter drawer
By moving the `wporg` conditional inside the method body, the filter drawer can be overridden without having to also override the entire section template.

Props celloexpressions.
Closes #42212.



git-svn-id: https://develop.svn.wordpress.org/trunk@41973 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 18:57:46 +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
Sergey Biryukov 1546ae8963 Tests: Fix typo in `test_do_action_with_multiple_callbacks_on_different_priorities()`.
Props withinboredom.
Fixes #42311.

git-svn-id: https://develop.svn.wordpress.org/trunk@41971 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 13:03:34 +00:00
Peter Wilson a77ccfad80 Build/Test tools: Move `wp_doing_ajax` defintion from class setup to test setup.
Moves defintion of ajax request in `WP_Ajax_UnitTestCase` to `setUp()` method to account for hooks being reset as part of `tearDown()`.

Props matthias.thiel for report.
Fixes #41561.



git-svn-id: https://develop.svn.wordpress.org/trunk@41970 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-23 05:10:25 +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
John Blackbourn 81149488e8 Docs: Correct docs introduced in [41965].
See #16778


git-svn-id: https://develop.svn.wordpress.org/trunk@41967 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 22:41:57 +00:00
Dion Hulse eaa0c3ac04 Tests: Return an exit code of 1 in the event that the database server for tests is unavailable.
This allows for automated scripts & test suites to handle the failure of the test suite easier.

Props danielbachhuber
Fixes #41916


git-svn-id: https://develop.svn.wordpress.org/trunk@41966 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 14:13:37 +00:00
Gary Pendergast 2ce903ffc3 Docs: Expand the docs for the `core_version_check_query_args` filter.
Add documentation for the parameters in the `$query` parameter.

Props MattyRob.
Fixes #16778.



git-svn-id: https://develop.svn.wordpress.org/trunk@41965 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 13:45:05 +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
Gary Pendergast 5233a95355 Updates: Add the `core_version_check_query_args` filter.
This filter allows the data being sent for core update checks to be controlled for privacy concerns.

Props toscho, MattyRob, swissspidy, pento.
Fixes #16778.



git-svn-id: https://develop.svn.wordpress.org/trunk@41962 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-21 11:54:47 +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
Sergey Biryukov 1a8b08418b Docs: Document `$wp_version` global in `wp_initial_constants()`.
Props mt8.biz.
Fixes #42259.

git-svn-id: https://develop.svn.wordpress.org/trunk@41959 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 22:03:59 +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
Sergey Biryukov 01c7f2cf7d Customize: Use typographic quotation marks in the strings added in [41768].
Props audrasjb, tobifjellner.
Fixes #42290. See #40104.

git-svn-id: https://develop.svn.wordpress.org/trunk@41956 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 14:06:42 +00:00
Sergey Biryukov 771b56d944 Menus: Remove an extra space in the `<ul>` tag in `Walker_Nav_Menu::start_lvl()`.
Fixes #42289.

git-svn-id: https://develop.svn.wordpress.org/trunk@41955 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 10:39:50 +00:00
Mel Choyce 8f08e79987 Customize Menus: Update capitalization of "next" to match case on the "Next" button.
Props hardeepasrani.
Fixes #42287.


git-svn-id: https://develop.svn.wordpress.org/trunk@41954 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 10:33:52 +00:00
Mel Choyce 0ff1f1b939 Customization Locking: Update error message to use existing strings.
Props ramiy.
See #42024.


git-svn-id: https://develop.svn.wordpress.org/trunk@41953 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-20 10:31:30 +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