Commit Graph

36246 Commits

Author SHA1 Message Date
Rachel Baker 7b4f4be327 REST API: Allow schema sanitization_callback to be set to null to bypass fallback sanitization functions.
The logic in WP_REST_Request->sanitize_params() added in [39091] did not account for `null` or `false` being the sanitization_callback preventing overriding `rest_parse_request_arg()`. This fixes that oversight, allowing the built in sanitization function to be bypassed. See #38593.

Merges [39563] to the 4.7  branch.

Props kkoppenhaver, rachelbaker, jnylen0.
Fixes #39042.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39642 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 17:48:10 +00:00
Rachel Baker 7d2dd7c861 Comments: Fix placement of the wp_update_comment_data filter to safeguard filtered data from triggering a database error.
Introduced in [38674], the wp_update_comment_data filter took place after the $data was sliced and prepared for the database update statement. The location of the filter assumed the result of anyone applying it would not change the data type or make structural modifications or additions to the $data array. 😅
This moves the wp_update_comment_data filter to take place before the $data is sliced and prepared for the database update statement.

Merges [39640] to the 4.7  branch.

Props dshanske for initial patch.
Fixes #39380.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39641 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 17:41:59 +00:00
Ella van Dorpe 02978beace Editor: Let the Add New link disappear in DFW mode.
The link was moved outside the heading in [38983].

Merges [39619] to the 4.7 branch.
Fixes #39313.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39634 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 14:55:31 +00:00
Gary Pendergast 82af7aba8d Media: Allow PDF fallbacks filter to process custom sizes.
This fixes an oversight in [39246], which added a hook for filtering the array of sizes used for PDF thumbnails, but failed to provide a way for sizes added through `add_image_size()` to be processed.

Merge of [39617] to the 4.7 branch.

Props gitlost.
Fixes #39231. See #38594.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39633 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:52:54 +00:00
Gary Pendergast 012cbda992 Twenty Seventeen: Ensure functions in `customize-controls.js` don't count on Customizer sections always being present
Before, the code assumed the `theme_options` section is always present, but it can be removed by plugins. This way, if it is, no JavaScript errors occur.

Merge of [39623] to the 4.7 branch.

Props westonruter.
Fixes #39355.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39632 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:47:43 +00:00
Gary Pendergast b1882aa8f1 REST API: Improve the `rest_*_collection_params` filter docs and fix the terms filter.
The `rest_{$taxonomy}_collection_params` filter in 4.7 is incorrectly using single quotes instead of double quotes, which means it is not working correctly as a dynamic filter. This fixes the quotes around the filter name, and also updates the docblocks for the other 3 similar filters for better conformance to the documentation standards.

Merge of [39621] to the 4.7 branch.

Props shazahm1hotmailcom, JPry, jnylen0.
Fixes #39300.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39631 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:33:15 +00:00
Gary Pendergast 81cc13dd49 REST API: Fix PHP warnings when `get_theme_support( 'post-formats' )` is not an array.
If `add_theme_support( 'post-formats' )` is called with no additional arguments, then `get_theme_support( 'post-formats' )` returns `true` rather than an array of supported formats. Avoid generating PHP warnings in this situation.

Merge of [39620] to the 4.7 branch.

Props dreamon11, ChopinBach.
Fixes #39293.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39630 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:29:24 +00:00
Gary Pendergast fab33a89e5 REST API: Add support for filename search in media endpoint.
In [38625], the functionality to search for attachments by filename was added via the `posts_clauses` filter and the `_filter_query_attachment_filenames()` function. This moves `_filter_query_attachment_filenames()` from `wp-admin/includes/post.php` to `wp-includes/post.php` so that it can be applied in the same manner in the REST API media endpoint.

Merge of [39598] to the 4.7 branch.

Props jblz, tyxla.
Fixes #39092.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39629 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:18:24 +00:00
Gary Pendergast 092fa83f60 REST API: Allow sending an empty or no-op comment update.
In general, updates that don't actually change anything should succeed. [39371] added tests for other object types, and this commit fixes empty updates for comments and adds the missing test.

Merges [39597] to the 4.7 branch.

Props jnylen0.
Fixes #38700.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39628 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:12:06 +00:00
Gary Pendergast ef084ac427 Tests: Restore the database connection earlier when switching test groups.
When plugins don't disable the `backupGlobals` PHPUnit option in their own tests, `$wpdb` is backed up and restored between classes of tests. The serialisation process used for this broke the database connection. This previously wasn't a problem, as it was reconnecting before each test.

[38398] introduced some changes that required the connection to be available in `setUpBeforeClass()`, earlier than in was previously reconnecting. This didn't cause warnings in Core, but it did cause warnings for plugins that don't disable the `backupGlobals` option.

The database connection now reconnects in `setUpBeforeClass()`. This change also fixes a few Core tests that weren't calling `parent::setUpBeforeClass()` or `parent::tearDown()` correctly.

Merges [39626] to the 4.7 branch.

Fixes #39327.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39627 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:07:05 +00:00
Dion Hulse 7e49d80783 Feeds: Do not translate the `lastBuildDate` field in RSS feeds.
Props stevenkword.
Partial Merge of [39613] to the 4.7 branch.
Fixes #39141.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39615 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 06:43:48 +00:00
Dion Hulse 2e6ae93cf2 Taxonomy: Restore the ability to use string-based `$args` in `wp_get_object_terms()`.
Props tyxla.
Merges [39578] to the 4.7 branch.
Fixes #39215.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39611 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:49:02 +00:00
Dion Hulse 8cbd30e3ce REST API: Do not include the `password` argument when getting media items
Currently, `attachment` is the only post type exposed via the REST API that
does not support password protection, but it's possible for other post types to
remove password support.

Props jnylen0.
Merges [39595] to the 4.7 branch.
Fixes #38977.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39610 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:45:50 +00:00
Dion Hulse 321599cc46 REST API: Do not error on empty JSON body
It's fairly common for clients to send `Content-Type: application/json` with an
empty body.  While technically not valid JSON, we've historically supported
this behaviour, so it shouldn't cause an error.

Props JPry, jnylen0.
Merges [39594] to the 4.7 branch.
Fixes #39150.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39609 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:42:23 +00:00
Dion Hulse 4d3fb455f5 Posts, Post Types: Ensure `is_page_template()` can only return true when viewing a singular post query.
Props natereist, dlh, johnbillion.
Merges [39599] to the 4.7 branch.
Fixes #39211.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39608 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:40:01 +00:00
Dion Hulse c41a10ecb1 PDF Images: Avoid a PHP Warning when attempting to process a file without an extension.
Props chandrapatel for initial patch.
Merges [39580] to the 4.7 branch.
Fixes #39195.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39607 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:38:41 +00:00
Dion Hulse 746b590ee7 Customize: Prevent edit shortcut from losing event handler after selective refresh.
Props sirbrillig.
Merges [39581] to the 4.7 branch.
See #27403.
Fixes #39100.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39606 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:37:41 +00:00
Dion Hulse 4ce30a06ff Bootstrap: Re-initialize any hooks added manually by `object-cache.php`.
Prior to 3.1 if a object cache dropin wanted to add actions, they needed to use `$wp_filter` directly.

Props jorbin.
Merges [39565] to the 4.7 branch.
Fixes #39132.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39605 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:36:33 +00:00
Adam Silverstein 126ba8a400 WP-API: JavaScript client - fix setup of models used by wp.api.collections objects.
Correct setup for the `model` attribute of `wp.api.collections` objects. Set the collection model as a function that returns a new model of the underlying type, instead of setting it as the model prototype. Fixes an issue where models for fetched collections weren't set up properly and didn't have the expected mixin methods such as `getCategories` available.

Props jesseenterprises.
Merges [39603] to the 4.7 branch.
Fixes #39070.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39604 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-15 13:01:26 +00:00
Ella van Dorpe c30742ceaf Editor: Remove target=_blank when unchecked in the link modal.
Merges [39601] to the 4.7 branch.
Fixes #39276.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39602 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 20:58:36 +00:00
Konstantin Obenland 652e264ef7 Themes: Add missing square bracket in jQuery selector.
Fixes a bug in Safari where the UI wasn't updated after deleting a theme due to
the incomplete selector.

Props Hristo Sg.
Merges [39586] to the 4.7 branch.
Fixes #39246.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39587 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 09:33:56 +00:00
Dion Hulse 55e4ca9b6f Customize: Prevent navigation in preview when clicking on child elements of preview links that have non-previewable URLs.
Props westonruter.
Merges [39584] to the 4.7 branch.
Fixes #39098.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39585 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 08:25:45 +00:00
Dion Hulse 46611f6153 De-Emphasise the minor (x.y.Z) version in `readme.html` by including only the major version for the 4.7 branch.
See #35554


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39582 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 07:59:10 +00:00
Dion Hulse 720311ae72 Bump the version in `package.json` to 4.7.1 after [39576].
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39579 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 06:06:51 +00:00
Dion Hulse 82d5647540 The 4.7 branch is now 4.7.1-alpha.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39576 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 04:53:57 +00:00
Dion Hulse 26caea9b90 Customize: Deprecate `page_home` nav menu item starter content in favor of `home_link`; replace usage in Twenty Seventeen.
Props celloexpressions, westonruter.
See #38615, #38114, [38991].
Merges [39561] to the 4.7 branch.
Fixes #39104.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39575 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:24:19 +00:00
Dion Hulse 78c5da52b5 Customize: Allow (optional) `url` parameter to be omitted in intercepted calls to `history.pushState()` and `history.replaceState()` in customize preview.
Fixes issue where calls without the `url` parameter erroneously end up rewriting the location path to `/undefined`.

Props Christian1012, westonruter.
Merges [39547] to the 4.7 branch.
Fixes #39175.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39574 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:10:30 +00:00
Dion Hulse 5fa5e22427 Customize: Trim whitespace for URLs supplied for `external_header_video` to prevent `esc_url_raw()` from making them invalid.
Props tyxla.
See #38172.
Merges [39560] to the 4.7 branch.
Fixes #39125.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39573 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:05:22 +00:00
Dion Hulse 2ee02541d5 Customize: Fix ability to shift-click on placeholder/pre-saved nav menu items in preview to focus on corresponding control.
Props westonruter.
Merges [39562] to the 4.7 branch.
Fixes #39102.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39572 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:03:22 +00:00
Dion Hulse 9431b1e310 Customize: Use selected user language for edit shortcuts in preview instead of site language.
Props ocean90.
Merges [39545] to the 4.7 branch.
Fixes #39009.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39571 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:58:21 +00:00
Dion Hulse ce5e63c224 Customize: Fix inability to delete nav menus by preventing `preview` filters from being added during `customize_save` admin ajax request.
Also prevent setting `nav_menu_locations[...]` values to `NaN` which gets sent as `null`.

Props westonruter.
See #30937, [38810].
Merges [39558] to the 4.7 branch.
Fixes #39103.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39570 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:56:53 +00:00
Dion Hulse 1a84a32ffd Customize: Prevent scrolling `custom_css` textarea to top when pressing tab.
Props tyxla, sstoqnov for testing, celloexpressions for testing.
See #38667.
Merges [39557] to the 4.7 branch.
Fixes #39134.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39569 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:55:02 +00:00
Dion Hulse cef6896bae Customize: Use `esc_url_raw()` instead of `wp_json_encode()` to eliminate extraneous slashes when outputting background image URL in CSS `url()`.
Props tyxla, westonruter.
See #22058.
Merges [39546] to the 4.7 branch.
Fixes #39145.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39568 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:45:58 +00:00
Dion Hulse 620d169b35 Customize: Prevent single quotes (apostrophes) in `custom_css` values from unexpectedly causing false positives for unbalanced character validation errors.
Props westonruter.
See #39218, #35395.
Merges [39559] to the 4.7 branch.
Fixes #39198.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39567 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:44:26 +00:00
Dion Hulse 0087500d9c REST API: Treat any falsy value as `false` in 'rest_allow_anonymous_comments'.
Extend the check in 'rest_allow_anonymous_comments' to accept any falsy value (previously this was an explicit check for `false`).

One possible failure case is that a plugin developer forgets to include a return value for some code path in their callback for this filter, leading to a value of null which is currently treated like `true`.

Props joehoyle, jnylen0.
Merges [39487] to the 4.7 branch.
Fixes #39010.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39566 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:39:13 +00:00
Helen Hou-Sandi eca76c5789 WordPress 4.7 "Vaughan".
It's very sassy.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39524 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 18:38:54 +00:00
Helen Hou-Sandi c882d12068 About page: Update video and REST API reference URLs.
props ocean90, kadamwhite, coffee2code.
see #38616 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39523 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 18:23:50 +00:00
Helen Hou-Sandi db37244980 Remove 4.7 cruft from `$_old_files`.
fixes #39113.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39521 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 17:17:37 +00:00
Helen Hou-Sandi 4f78d35064 Post-RC3 bump.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39519 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 07:22:19 +00:00
Helen Hou-Sandi 9ec1bf21ac About page: Bump image versions because CDN caching.
props pento.
see #38616 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39518 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 07:12:55 +00:00
Helen Hou-Sandi b23d5f2a6b WordPress 4.7 RC3.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39516 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 06:58:29 +00:00
Joe McGill e2633109b1 About page: Resposive images and CDN media URLs.
This adds `srcset` and `sizes` to the about page images, including
art direction, via `<picture>` for the lead Twenty Seventeen image.

This also replaces URLs for all images and feature videos to their
CDN locations on s.w.org.

Props helen, pento, joemcgill.
Fixes #38616 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39515 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 06:57:25 +00:00
Helen Hou-Sandi f872b5557e About page: Imagery and beautification.
Still to come: responsive images, optimized videos, and CDN URLs.

merges [39512] to the 4.7 branch.
props melchoyce, helen, ramiabraham.
see #38616.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39513 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 04:01:29 +00:00
Weston Ruter a7bed1e872 Customize: Prevent infinite full refresh from occurring when selective refresh falls back for a nav menu that has items excluded from rendering via filtering.
Merges [39510] onto 4.7 branch.
Fixes #38612 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39511 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 02:52:14 +00:00
Dominik Schilling (ocean90) ea175aae36 Comments: Merge a similar string between comments.php, XML-RPC and the REST API comments controller.
Merge of [39508] to the 4.7 branch.

Props ramiy.
See #39013.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39509 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 20:17:06 +00:00
Weston Ruter cee7b15ead Customize: Defer populating `post_name` for `auto-draft` posts in customized state until posts are published.
The ultimate `post_name` is stored in postmeta until the post is published. The `get_page_by_path()` function does not exclude `auto-draft` posts. Revert changes to `wp_unique_post_slug()` from [39411] which excluded `auto-draft` posts.

Props westonruter, dlh for testing, helen for testing.
Merges [39506] onto 4.7 branch.
Fixes #39078 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39507 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 19:38:16 +00:00
Weston Ruter 8886763a6d Customize: Ensure `changeset_uuid` query param is removed from the `customize.php` window's location once a changeset has been published (committed) with starter content.
Props westonruter, dlh for testing.
Merges [39504] onto 4.7 branch.
Fixes #39081 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39505 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 16:56:50 +00:00
Weston Ruter 49cb84ba0d Customize: Prevent posts/pages imported via starter content from being dropped when adding post/page stubs via nav menus and the dropdown-pages control.
Props westonruter, dlh for testing.
Merges [39502] onto 4.7 branch.
Fixes #39071 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39503 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 16:48:16 +00:00
Andrew Ozz 9d4bdea5c3 TinyMCE: fix the styling of notices generated by the editor UI.
Props: mor10, karmatosed, azaozz.
Fixes #38917 for 4.7.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39501 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 15:10:01 +00:00
Weston Ruter fee8b61eb1 Customize: Ensure `textarea` for Custom CSS displays as code (in LTR) when an RTL language is active.
Merges [39499] onto 4.7 branch.
Fixes #39085 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39500 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 13:59:49 +00:00