Commit Graph

36246 Commits

Author SHA1 Message Date
Weston Ruter 68b9b45548 Customize: Ensure `WP_Customize_Setting::value()` returns previewed value for custom types utilizing the `customize_value_{$id_base}` filter.
Fixes #38864.


git-svn-id: https://develop.svn.wordpress.org/trunk@39318 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 05:59:12 +00:00
Helen Hou-Sandi e1215e1268 Twenty Seventeen: Avoid an undefined index notice after [39291].
props westonruter.
see #38847.


git-svn-id: https://develop.svn.wordpress.org/trunk@39317 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 04:54:14 +00:00
Sergey Biryukov bc11236b4c I18N: Use 'WordPress hook name' instead of 'PHP hook name' in translator comments added in [39315].
See #38862.

git-svn-id: https://develop.svn.wordpress.org/trunk@39316 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:43:49 +00:00
Sergey Biryukov b706194ec3 I18N: Add translator comments for strings in `_deprecated_*()` functions.
See #38862.

git-svn-id: https://develop.svn.wordpress.org/trunk@39315 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:38:16 +00:00
Sergey Biryukov d9c848142e I18N: Remove unnecessary `__()` calls in `_rotate_image_resource()` and `_flip_image_resource()`.
Use `_deprecated_function()`'s native strings.

Props ramiy.
Fixes #38862.

git-svn-id: https://develop.svn.wordpress.org/trunk@39314 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:29:51 +00:00
Sergey Biryukov 78ae6a3ac0 REST API: Merge some more permission error strings missed in [39309].
See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39313 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:20:08 +00:00
Sergey Biryukov 4e5fdda8f9 Text Changes: Merge strings referring to `list_users` capability.
See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39312 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:15:10 +00:00
Sergey Biryukov ecb95b299c I18N: Merge two 'RSS Error:' strings.
Props ramiy.
Fixes #38861.

git-svn-id: https://develop.svn.wordpress.org/trunk@39311 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:56:01 +00:00
Sergey Biryukov ae7642de08 REST API: After [39306], move `author_ip` argument to the correct place.
See #38822.

git-svn-id: https://develop.svn.wordpress.org/trunk@39310 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:51:01 +00:00
Sergey Biryukov dad2cdf083 REST API: Merge and clarify some permission error strings.
Fixes #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39309 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:45:30 +00:00
Sergey Biryukov 81353e76be Text Changes: Merge and clarify some permission error strings in the admin.
See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39308 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:37:25 +00:00
Sergey Biryukov abfbc08c34 I18N: Merge two 'ERROR:' strings.
Props ramiy.
Fixes #38860.

git-svn-id: https://develop.svn.wordpress.org/trunk@39307 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:08:40 +00:00
Sergey Biryukov 24b1b19c50 REST API: After [39302], clarify `author_ip` parameter in error message.
Properties of objects should not be translated, and therefore are pulled out of the translation strings.

Props ramiy.
Fixes #38822.

git-svn-id: https://develop.svn.wordpress.org/trunk@39306 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:05:36 +00:00
Sergey Biryukov b61f722856 REST API: Merge two similar permission error strings in `class-wp-rest-comments-controller.php`.
We're checking if `current_user_can( 'moderate_comments' )` here, not the specific comment permissions.

See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39305 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 00:09:07 +00:00
Sergey Biryukov d087812e08 REST API: Merge two similar permission error strings.
Props ramiy.
Fixes #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39304 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 23:52:21 +00:00
Mike Schroder 0ab17d2158 Media: Allow override of PDF setup for multiple pages or DPI.
After [39187], WordPress started loading only the first page of a PDF.

This is appropriate for performance, but made it impossible to
write plugins that read other pages without overriding `load()`.

Introduces `WP_Image_Editor_Imagick->pdf_setup()`, to allow an override
to change WordPress' rendering DPI defaults or which pages are loaded.

Fixes #38832. See #38522, #31050.
Props markoheijnen, joemcgill, mikeschroder.

git-svn-id: https://develop.svn.wordpress.org/trunk@39303 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 22:21:19 +00:00
Rachel Baker aa4af7839e REST API: On Comment create, limit the ability to set the `author_ip` value directly.
Users without the moderate_comments capability can no longer set the `author_ip` property directly, and instead receive a `WP_Error` if they attempt to do so. Otherwise, the `author_ip property` is populated from `$_SERVER['REMOTE_ADDR']` if present and a valid IP value. Finally, fallback to 127.0.0.1 as a last resort.

Props dd32, rachelbaker, joehoyle.
Fixes #38819.

git-svn-id: https://develop.svn.wordpress.org/trunk@39302 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 21:12:03 +00:00
Helen Hou-Sandi 9385bda4ce Autoprefixer for [39249].
Fixes one errant value and re-aligns some existing prefixed property values so they don't get doubled when precommit/postcss is run again in the future.

props davidakennedy.
see #29158.


git-svn-id: https://develop.svn.wordpress.org/trunk@39301 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 21:05:33 +00:00
David A. Kennedy 364d79e205 Twenty Seventeen: Make all Codex links in DocBlocks use HTTPS
Props johnpgreen.

Fixes #38854.


git-svn-id: https://develop.svn.wordpress.org/trunk@39300 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:48:47 +00:00
Ella van Dorpe 1e4c6afab3 TinyMCE: fix automatic scroll on page load.
Set focus when new content is loaded in the editor, but not when it's the initial load.

Fixes #38511.



git-svn-id: https://develop.svn.wordpress.org/trunk@39299 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:37:50 +00:00
Joe Hoyle 96dba32dfb REST API: Clarify parameters when used in error strings.
Properties of objects should not be translated, and therefore are pulled out of the translation strings.

Props ocean90, ramiy, danielbachhuber.
Fixes #38822.

git-svn-id: https://develop.svn.wordpress.org/trunk@39298 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:20:01 +00:00
David A. Kennedy 05b394ccaa Twenty Seventeen: Adds `background-attachment: fixed;` to devices that should support it
iOS  disables this feature under the hood, but it also distorts the images – unlike other mobile devices that don't support it. So this adds a  check for both `background-attachment: fixed` support or whether it’s an iOS device - passing it adds the class `background-fixed` which is used to add the proper styles.

It also lowers the media query so the parallax-like style is present on a wider range of screens since this bug can be better targeted and avoided. In this way, screens that aren't the offending devices aren't punished merely based on screen size.

Props joemcgill, laurelfulford, helen.

Fixes #38395.


git-svn-id: https://develop.svn.wordpress.org/trunk@39297 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:10:18 +00:00
Joe Hoyle ba5a196d9e REST API: Change “ipv4” types to “ip” to support ipv6.
Stop presuming IP address are IPv4, instead make the type “ip” to be agnostic of IP version. This fixes requests with ipv6 addresses for comments in core.

Props dd32, schlessera, danielbachhuber.
Fixes #38818.

git-svn-id: https://develop.svn.wordpress.org/trunk@39296 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 19:32:03 +00:00
Joe Hoyle db07183b6f REST API: Check read permissions on posts when viewing comments.
With a few tests for getting / creating comments to reflect core behaviour.

Props timmyc.

git-svn-id: https://develop.svn.wordpress.org/trunk@39295 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 19:06:26 +00:00
Helen Hou-Sandi b34803f431 Twenty Seventeen: Rename the starter content menus to match the menu area names.
Saves strings and is more descriptive.

props davidakennedy.
see #38615.


git-svn-id: https://develop.svn.wordpress.org/trunk@39294 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 19:04:25 +00:00
Rachel Baker 2916ca534c REST API: Add test case for `users/me` endpoint that the `context` param defaults to `view`.
Props danielbachhuber.
See #38842.

git-svn-id: https://develop.svn.wordpress.org/trunk@39293 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:58:25 +00:00
Rachel Baker 7552367e7a REST API: Remove the `karma` property and query parameter from the Comments endpoints.
WordPress has not used the `karma` property internally for the past 8 years. There is no need to expose it in the REST API endpoints. Sites that use `karma` can include it using the `register_rest_field()` function.

Props dd32, danielbachhuber.
Fixes #38821.

git-svn-id: https://develop.svn.wordpress.org/trunk@39292 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:52:19 +00:00
David A. Kennedy ebe736af3f Twenty Seventeen: Ensure the use of proper image size for custom header image
The `sizes` attribute was calculated incorrectly, resulting in the browser downloading the wrong resource. This filters the attribute to correct that.

Before the filter, the `img` contained:
`sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px"`

And after:
`sizes="100vw"`

Props joemcgill, transl8or.

Fixes #38847.


git-svn-id: https://develop.svn.wordpress.org/trunk@39291 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:42:16 +00:00
Rachel Baker f553ad6277 REST API: On comment create, return an error if the `type` property is set to anything other than `comment`.
Of the default comment_types, only comments are expected to be created via the REST API endpoint. Comments do not have registered types the way that Posts do, so we do not have a method to accurately check permissions for arbitrary comment types.

Props dd32, boonebgorges, rachelbaker.
Fixes #38820.

git-svn-id: https://develop.svn.wordpress.org/trunk@39290 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:36:10 +00:00
Rachel Baker 659822098a REST API: Allow `parent` property to be explicitly set to `0` when creating or updating a Post.
Props lucasstark, danielbachhuber.
Fixes #38852.

git-svn-id: https://develop.svn.wordpress.org/trunk@39289 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:11:49 +00:00
Rachel Baker ff38fc46e4 REST API: On comment create, return an error if the `post` parameter does not relate to a valid WP_Post object.
Return a `WP_Error` object for attempts to create a comment without an empty or invalid `post` ID.

Props dd32, jnylen0, rachelbaker.
Fixes #38816.

git-svn-id: https://develop.svn.wordpress.org/trunk@39288 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 16:55:03 +00:00
Rachel Baker cceb9a6053 REST API: On comment create, fallback to the `user_agent` header value.
If a user-agent is not explicitly provided in the `author_user_agent` parameter, fallback to the `user_agent` value in the request header.

Props dd32, jnylen0, rachelbaker.
Fixes #38817.

git-svn-id: https://develop.svn.wordpress.org/trunk@39287 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 16:21:27 +00:00
Helen Hou-Sandi faf751b039 Twenty Seventeen: Remove some extraneous function calls.
fixes #38848.


git-svn-id: https://develop.svn.wordpress.org/trunk@39286 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 06:35:15 +00:00
Weston Ruter c1b2e9dd41 Customize: Remove obsolete edit shortcut style rules from Twenty Seventeen.
Props celloexpressions.
Fixes #38776.


git-svn-id: https://develop.svn.wordpress.org/trunk@39285 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 05:22:00 +00:00
Ella van Dorpe 48830b5e10 TinyMCE: remove extra space in tooltip.
This prevents wrapping and looks better, even though there seems to be some space between the other control key characters.

See #38063.



git-svn-id: https://develop.svn.wordpress.org/trunk@39284 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 23:58:11 +00:00
Peter Wilson bd320a9965 Taxonomy: Update `register_taxonomy` hook to use `WP_Taxonomy` object.
Casts `WP_Taxonomy` to an array for passing to the `register_taxonomy` hook. This maintains backward compatibility with the processed arguments used prior to WordPress 4.7.

Fixes #38765.


git-svn-id: https://develop.svn.wordpress.org/trunk@39283 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 23:34:42 +00:00
Ella van Dorpe bbd3e0174e TinyMCE views: fix Firefox issues.
* Set focus before rendering to prevent reload in Firefox.
* Rerender views if they are unloaded.
* Remove timeout added in [29513].
* Fix argument in wp.mce.views.render.
* Empty views on hide. Missed in #36434.

Props gitlost, azaozz, iseulde.
Fixes #38511.



git-svn-id: https://develop.svn.wordpress.org/trunk@39282 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 20:31:12 +00:00
Sergey Biryukov 3f11a75b2d Docs: Use 3-digit, x.x.x style semantic versioning for `@since 4.7.0` entries.
See #37770.

git-svn-id: https://develop.svn.wordpress.org/trunk@39281 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 18:27:16 +00:00
Sergey Biryukov f493ebb369 Taxonomy: Prevent `wp_list_categories()` from producing not well-nested output if `hide_title_if_empty` is true.
Props chesio.
Fixes #38839. See #33460.

git-svn-id: https://develop.svn.wordpress.org/trunk@39280 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 18:01:13 +00:00
Joe McGill 1c547f56c1 Twenty Seventeen: Additional default header image optimizations.
This is a follow-up to [39248] that applies a bit more compression to
the default header image in Twenty Seventeen.

Props Presskopp, lukecavanagh.
Fixes #38793.

git-svn-id: https://develop.svn.wordpress.org/trunk@39279 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 17:12:49 +00:00
Sergey Biryukov eb26b2a6a7 Text Changes: Merge some duplicate strings with the same meaning in error messages, adjust some other strings for consistency and accuracy.
Props ramiy, SergeyBiryukov.
Fixes #38808.

git-svn-id: https://develop.svn.wordpress.org/trunk@39278 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 15:52:18 +00:00
Andrea Fercia b2983232c3 Small coding standards cleanup of wp-custom-header.js.
Small coding standards cleanup of wp-custom-header.js after [39272].


git-svn-id: https://develop.svn.wordpress.org/trunk@39277 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 09:03:39 +00:00
Weston Ruter a3b66814a7 Customize: Add unit tests for importing theme starter content.
Props welcher, westonruter.
See #38114, #38533, #38615.
Fixes #38540.


git-svn-id: https://develop.svn.wordpress.org/trunk@39276 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 08:17:57 +00:00
Gary Pendergast 365241878f Database: Add support for `LIKE`-escaped tables in `::get_table_from_query()`.
The `SHOW TABLES LIKE` query can be used to search for tables that match a pattern, `wp\_123\_%`, for example. While this isn't the name of an actual table, the `wp_123_` prefix can be used by database drop-ins to direct the query correctly. This change removes the escaping and `%` modifier, to provide this usable prefix.

Props andy, pento.
Fixes #38751.



git-svn-id: https://develop.svn.wordpress.org/trunk@39275 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 04:20:22 +00:00
Boone Gorges 206a330d72 Comments: Query used to fill comment descendants should reset 'offset' and 'number' params.
Descendant queries should not inherit the 'offset' and 'number'
parameters of the parent query, or descendants will be missed.

Previously: [38497].

See #37696.

git-svn-id: https://develop.svn.wordpress.org/trunk@39274 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 03:02:40 +00:00
Joe McGill 1e05bf877e Twenty Seventeen: Add styles for custom header video controls.
Following [39272], this uses the `header_video_settings` filter to modify
the default video header control markup and adds theme specific styles
for the play/pause button.

Props melchoyce, laurelfulford, joemcgill, davidakennedy, bradyvercher.
Fixes #38697.

git-svn-id: https://develop.svn.wordpress.org/trunk@39273 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 23:37:42 +00:00
Joe McGill b5563ef917 Themes: Improve a11y and extendability of custom video headers.
This adds play/pause controls to video headers, along with voice
assistance, using `wp.a11y.speak`, to make custom video headers more
accessible. To make styling the play/pause button easier for themes,
CSS has been omitted from the default implementation.

This also includes a refactor of the `wp.customHeader` code to introduce
a `BaseHandler` class, which can be extended by plugins and themes to modify
or enhance the default video handlers.

Props davidakennedy, afercia, bradyvercher, joemcgill, adamsilverstein, rianrietveld.
Fixes #38678.

git-svn-id: https://develop.svn.wordpress.org/trunk@39272 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 23:25:28 +00:00
Weston Ruter ac9a74eff5 Customize: Ensure Close button actually closes customizer (instead of going back) after switching to a different theme inside a `customize-loader` iframe.
Fixes #38833.


git-svn-id: https://develop.svn.wordpress.org/trunk@39271 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 22:16:10 +00:00
Weston Ruter 0dbb9c4248 Customize: Prevent edit shortcut buttons from being inserted into container elements in the `head` or into elements which should not get interactive children.
See #27403, #38672.
Fixes #38830.


git-svn-id: https://develop.svn.wordpress.org/trunk@39270 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 20:36:40 +00:00
Dominik Schilling (ocean90) a9a8a9b121 Users: In `edit_user()` fall back to site's locale instead of `en_US` for invalid user locales.
See #38632, #29783.
Fixes #38798.

git-svn-id: https://develop.svn.wordpress.org/trunk@39269 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 20:11:12 +00:00