Commit Graph

35645 Commits

Author SHA1 Message Date
Pascal Birchler 9f18722721 I18N: Remove unused `$wpdb` global from `get_locale()` after [39005].
Originally added in [38976], but reverted soon after.

Props johnjamesjacoby.
Fixes #38601.

git-svn-id: https://develop.svn.wordpress.org/trunk@39067 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-01 07:37:29 +00:00
Aaron Jorbin 61b50ae964 Update link in register_meta about 4.6 changes
The blog post, while originally canonical, was later updated to include additional changes. The ticket includes all the changes and alot of rational for why things changed.

Props Mista-Flo, DrewAPicture, morganestes.
Fixes #38254.



git-svn-id: https://develop.svn.wordpress.org/trunk@39066 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-01 06:53:17 +00:00
Dion Hulse cacd16cf5d Themes: Update the unit tests to handle [39064] and #31550.
`test_default_theme_in_default_theme_list()` was always being skipped after #31550, this causes it to once again check that the unit tests are up to date and include the latest default theme.
`test_default_themes_have_textdomain()` didn't play happy when a default theme wasn't installed on a site.

See #31550, #29925, #38551.


git-svn-id: https://develop.svn.wordpress.org/trunk@39065 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-01 03:13:27 +00:00
Dion Hulse b92ebd9e2d Upgrade: Install new themes upon upgrade again.
This partially reverts [35738], which has shown to provide a bad user experience for users seeking to experiment with TwentySeventeen.

This will result in TwentySixteen being installed in addition to TwentySeventeen.

See #38551.


git-svn-id: https://develop.svn.wordpress.org/trunk@39064 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-01 01:23:17 +00:00
John Blackbourn 99267c4e1d Plugins: Correct the `since` docs for the various `plugin_action_links` filters.
Props tfrommen, SergeyBiryukov


git-svn-id: https://develop.svn.wordpress.org/trunk@39063 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 19:37:39 +00:00
John Blackbourn d1707d6542 Posts, Post Types: Prevent users from being able to delete a protected meta field from a post.
Previously a user could remove a protected meta field by using their browser developer tools to alter the form field properties in the Custom Fields meta box, given that they know the ID of the protected meta field. This change prevents this by preventing any change to a protected meta field, including changing its key.

Props ajoah, johnbillion, peterwilsoncc
Fixes #38293


git-svn-id: https://develop.svn.wordpress.org/trunk@39062 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 19:29:07 +00:00
Joe Hoyle 0e609fa717 REST API: Sanitize arrays being sent as CSVs.
In #38586 the ability to parse arrays as csv was introduced, however it didn't add any support for validating csv arrays. This adds such sanitization, and also a good amount of unit tests for all sanitization baed off schema.

See #38586.


git-svn-id: https://develop.svn.wordpress.org/trunk@39061 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 17:07:14 +00:00
Weston Ruter abc7c676a4 Customize: Ensure state query params persist in preview through calls to `history.pushState()` & `history.replaceState()`.
Allow history to be manipulated before DOM ready by sourcing state params from the current URL instead of from the `wp.customize.settings` object, since they will be the same anyway. This fixes a JS error since `wp.customize.settings` is not defined before DOM ready.

Amends [38810].
See #30937.
Fixes #38592.


git-svn-id: https://develop.svn.wordpress.org/trunk@39060 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 16:41:06 +00:00
Andrea Fercia f34e252334 Administration: remove a leftover check from get_submit_button.
Props sstoqnov.
Fixes #34891.


git-svn-id: https://develop.svn.wordpress.org/trunk@39059 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 16:38:21 +00:00
Joe Hoyle 89ce913169 REST API: Add support for "integer" type for meta and options
Previously Settings only supported "number" which meant it was possible to push floats to things like posts_per_page. This means now developers can also specify `type => ineger` in meta nad settings resgration.

Props flixos90.
Fixes #38393.


git-svn-id: https://develop.svn.wordpress.org/trunk@39058 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 16:06:54 +00:00
Boone Gorges fb3c57a399 Taxonomy: Remove redundant 'get_terms_args' filter call from `WP_Term_Query`.
Introduced in [37572]. The correct 'get_terms_args' filter call is in
`WP_Term_Query::get_terms()`.

Props Tkama.
Fixes #38589.

git-svn-id: https://develop.svn.wordpress.org/trunk@39057 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 15:46:37 +00:00
Gary Pendergast d66ba1ee7a REST API: Allow a CSV list of user roles to be passed to `/users`.
After [39048], this changes explicitly parses the list of user roles as slugs, and adds tests.

Props jnylen0.
Fixes #38557.



git-svn-id: https://develop.svn.wordpress.org/trunk@39056 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 11:10:37 +00:00
Gary Pendergast 0153b0bb9b REST API: Allow a CSV list of term IDs to be passed to `/posts`.
[39048] added CSV support to array types, this change explicitly parses term lists as IDs, and adds tests.

Props timmydcrawford, pento.
Fixes #38553.



git-svn-id: https://develop.svn.wordpress.org/trunk@39055 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 11:05:37 +00:00
Drew Jaynes ee84a7a31a Docs: Clarify descriptions for `home_url()` and `get_home_url()` on the true effect of the `$scheme` parameter.
Part props thomaswm.
Props stevenlinx.
Fixes #36468.


git-svn-id: https://develop.svn.wordpress.org/trunk@39054 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 07:05:22 +00:00
Drew Jaynes 8d94a5ae26 Docs: Fix an incorrect pseudo-parameter referenced in the hook doc for the `widget_tag_cloud_args` filter.
Props backermann.
Fixes #37654.


git-svn-id: https://develop.svn.wordpress.org/trunk@39053 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 06:39:06 +00:00
DrewAPicture 2e3a6f36d2 Docs: Update the DocBlock description for `WP_Query::is_single()` to mention that it works for any post types excluding pages.
Props ryankienstra.
Fixes #38225.


git-svn-id: https://develop.svn.wordpress.org/trunk@39052 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 06:33:02 +00:00
Drew Jaynes 297076eda4 Docs: Fix multiple trivial typos throughout a variety of core files.
Props ottok.
Fixes #38489.


git-svn-id: https://develop.svn.wordpress.org/trunk@39051 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 06:27:53 +00:00
Peter Wilson 3c97cbca24 Themes: Exit `wp-custom-header.js` early in browsers wihout modern events.
Adds a check for `window.addEventListener` support before attempting to use it. In browsers without support, the file is exited early to avoid throwing a JavaScript error.

Fixes #38585.


git-svn-id: https://develop.svn.wordpress.org/trunk@39050 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 06:16:15 +00:00
Drew Jaynes 4d115e4875 Docs: The `query_vars` filter used in the REST posts controller should be notated as a duplicate rather than a new hook.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39049 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 05:49:25 +00:00
Gary Pendergast c9618c09ad REST API: Allow parameters defined as `array` to be sent as CSVs.
This allows parameters that are often handled as CSVs to be properly parsed.

Fixes #38586.



git-svn-id: https://develop.svn.wordpress.org/trunk@39048 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 05:44:56 +00:00
Ryan McCue 4f9bc7535d REST API: Support password on non-post post types.
The password field was incorrectly only added to "post" post types, but is supported for all post types in the Dashboard UI.

Props jnylen0.
Fixes #38582.


git-svn-id: https://develop.svn.wordpress.org/trunk@39047 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 03:52:08 +00:00
Gary Pendergast a86bc6f565 REST API: Add support for arrays in schema validation and sanitization.
By allowing more fine-grained validation and sanitisation of endpoint args, we can ensure the correct data is being passed to endpoints.

This can easily be extended to support new data types, such as CSV fields or objects.

Props joehoyle, rachelbaker, pento.
Fixes #38531.



git-svn-id: https://develop.svn.wordpress.org/trunk@39046 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 01:47:36 +00:00
John Blackbourn 5b4f2b3021 XML-RPC: Correctly handle empty and duplicate comments.
This prevents `wp_die()` being sent in response to an XML-RPC call that attempts to submit a duplicate comment, and correctly returns an error in response to an attempt to submit an empty comment.

Props markoheijnen, websupporter.
Fixes #14452, #38466.
See #36901


git-svn-id: https://develop.svn.wordpress.org/trunk@39045 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 01:26:10 +00:00
Gary Pendergast 7dad21f34c REST API: Allow Content-Type on CORS requests.
This allows `POST` requests with a wider variety of `Content-Type' headers - `Content-Type: application/json`, for example.

Props jnylen0.
Fixes #37994.



git-svn-id: https://develop.svn.wordpress.org/trunk@39044 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 00:33:25 +00:00
Rachel Baker b5a4df509e REST API: Correctly test the roles parameter when creating a user in `WP_Test_REST_Users_Controller`.
Props jnylen0.
Fixes #38575.

git-svn-id: https://develop.svn.wordpress.org/trunk@39043 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 00:27:17 +00:00
Gary Pendergast 67044fe410 REST API: Add `PATCH` to CORS allowed methods.
Editable resources in the REST API accept the `PATCH` method, but the CORS headers don't mention it.

Props jnylen0.
Fixes #38546.



git-svn-id: https://develop.svn.wordpress.org/trunk@39042 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-31 00:18:14 +00:00
Rachel Baker 6413c1efce REST API: Delete temporary files during teardown of `WP_Test_REST_Attachments_Controller`.
Props jnylen0.
Fixes #38574.

git-svn-id: https://develop.svn.wordpress.org/trunk@39041 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 23:31:06 +00:00
Dominik Schilling (ocean90) f4b61df0e4 I18N: Don't use `get_user_option()` for retrieving user's language.
`get_user_option()` checks for both option types, site and network. Since `locale` is only a network option we can directly access the field via `WP_User`s magic getter.

Props johnjamesjacoby.
Fixes #38578.

git-svn-id: https://develop.svn.wordpress.org/trunk@39040 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 22:25:34 +00:00
Dominik Schilling (ocean90) 7d378f82d0 I18N: Use correct value for the `for` attribute of the user language setting label.
Props johnjamesjacoby.
Fixes #38576.

git-svn-id: https://develop.svn.wordpress.org/trunk@39039 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 21:57:17 +00:00
Weston Ruter 4de2e30bb4 Customize: Prevent auto-draft post/page stubs from being saved with empty slugs or published with non-unique slugs.
* Allow `WP_Customize_Nav_Menus::insert_auto_draft_post()` to take full post array to pass to `wp_insert_post()`, except for `post_status`. Require `post_title`. 
* Ensure empty `post_name` gets explicitly set to slugified `post_title`.
* Explicitly allow only `post_type` and `post_title` params in `WP_Customize_Nav_Menus::ajax_insert_auto_draft_post()`.
* Use `wp_update_post()` instead of `wp_publish_post()` to ensure unique slugs are assigned to published auto-draft posts.
* Re-use `WP_Customize_Nav_Menus::insert_auto_draft_post()` when inserting stubs from starter content.
 
See #38114, #38013, #34923.
Fixes #38539.


git-svn-id: https://develop.svn.wordpress.org/trunk@39038 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 20:20:54 +00:00
Drew Jaynes 32c7696700 Docs: Add a slightly less ambiguous list of return types for `rest_ensure_response()`.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39037 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:52:58 +00:00
Drew Jaynes deb258cd33 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Users_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39036 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:51:30 +00:00
John Blackbourn 7b7164e198 Role/Capability: Introduce capability tests for promoting, removing, and deleting users, and capability tests for editing comments.
Also introduces a shared fixture for a super admin user.

See #38236


git-svn-id: https://develop.svn.wordpress.org/trunk@39035 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:30:03 +00:00
Drew Jaynes c8d362a3b2 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_User_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39034 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:27:28 +00:00
Drew Jaynes 496d610dfc Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Terms_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39033 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:20:58 +00:00
Drew Jaynes 75a1951892 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Term_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39032 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:08:36 +00:00
Drew Jaynes b3bb03b33a Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Taxonomies_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39031 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:06:23 +00:00
Drew Jaynes ed2321d7f1 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Settings_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39030 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 18:00:24 +00:00
Drew Jaynes b58bb705ce REST: Fix some errant `else if` conditions and add a few missing periods on inline comments.
Props mrahmadawais.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39029 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 17:53:04 +00:00
Drew Jaynes 5fdf3ac313 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Revisions_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39028 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 17:49:14 +00:00
Drew Jaynes d10a54f83c REST: Fix a yoda condition in `WP_REST_Request::get_parameter_order()` and add a missing period for an inline comment in `WP_REST_Request::from_url().
Props mrahmadawais.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39027 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 17:41:15 +00:00
Drew Jaynes ee32082734 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Posts_Controller` class.
Props Soean, mrahmadawais, flixos90, DrewAPicture.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39026 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 17:36:15 +00:00
Drew Jaynes d3e10335d7 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Post_Types_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39025 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 16:50:15 +00:00
Drew Jaynes 9b648569f2 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Post_Statuses_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39024 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 16:43:12 +00:00
Drew Jaynes bc917ac0c7 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Post_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39023 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 16:35:30 +00:00
Drew Jaynes 79ed959c30 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39022 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 16:32:05 +00:00
Drew Jaynes f6e25fb836 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.


git-svn-id: https://develop.svn.wordpress.org/trunk@39021 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 16:19:22 +00:00
John Blackbourn 765d5feb08 Customize: Avoid using `assertNotFalse()` in tests because it's not available in PHPUnit 3.6.
See #35395


git-svn-id: https://develop.svn.wordpress.org/trunk@39020 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 15:41:49 +00:00
Andrea Fercia 6f3e4849fd Accessibility: Remove target=_blank from the help tab links in network.php.
Stop taking control of users' browsers.

Props wolly.
Fixes #38572. See #23432.


git-svn-id: https://develop.svn.wordpress.org/trunk@39019 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 15:18:35 +00:00
Weston Ruter 7382bdd6b3 Customize: Prevent toggling edit shortcuts when doing shift-click or when clicking on a descendent of an interactive element.
See #38532, #27403.
Fixes #38554.


git-svn-id: https://develop.svn.wordpress.org/trunk@39018 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-30 14:58:47 +00:00