Commit Graph

38549 Commits

Author SHA1 Message Date
Adam Silverstein
fd5ba80c5c Media: Improve display and accessibility of meta data in detail view.
* Add a `human_readable_duration` function including tests.
* Add 'pixels' after image width/height.
* Add screen reader text for durations.

Props Presskopp, kiranpotphode, milindmore22, stormrockwell, afercia.
Fixes #39667. 



git-svn-id: https://develop.svn.wordpress.org/trunk@43633 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-08 04:19:40 +00:00
Sergey Biryukov
37b53387ff Docs: Update @since version for (un)registered_taxonomy_for_object_type actions introduced in [43558].
See #44733.

git-svn-id: https://develop.svn.wordpress.org/trunk@43631 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-06 07:48:32 +00:00
Felix Arntz
b33420db6c Upgrade/Install: Fix coding standard errors after [43629].
See #44896.


git-svn-id: https://develop.svn.wordpress.org/trunk@43630 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 12:49:29 +00:00
Felix Arntz
46e5c6c91b Upgrade/Install: Introduce populate_site_meta().
Fixes #44896. See #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@43629 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 11:01:36 +00:00
flixos90
88b725e1cb Upgrade/Install: Introduce populate_network_meta(), moving logic out of populate_network().
Fixes #44895. See #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@43628 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 10:44:02 +00:00
Felix Arntz
f1e1b6299e Upgrade/Install: Add support for an optional $options parameter to populate_options().
Fixes #44893. See #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@43627 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-05 09:38:04 +00:00
Sergey Biryukov
811eef33a3 Privacy: When clicking a confirmation link for a privacy request, return a WP_Error object if the link has expired.
Returning a string caused a success message to be displayed instead of the correct error message.

Props desrosj.
Fixes #44685.

git-svn-id: https://develop.svn.wordpress.org/trunk@43623 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 21:43:13 +00:00
Sergey Biryukov
c41c128fda Docs: Update @since version for edit_post_{$post->post_type} action introduced in [43535] to 4.9.9.
See #34706.

git-svn-id: https://develop.svn.wordpress.org/trunk@43616 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 21:08:33 +00:00
Sergey Biryukov
39c97a768a Docs: Correct parameter type for WP_Privacy_Policy_Content::notice().
Props burhandodhy.
Fixes #44877.

git-svn-id: https://develop.svn.wordpress.org/trunk@43609 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 14:14:15 +00:00
Peter Wilson
0eda564507 Cron API: Clarify documentation for wp_reschedule_event().
Expands documentation to indicate `wp_schedule_event()` ought to be used for rescheduling an upcoming event, while `wp_reschedule_event()` is used for internally rescheduling a recurring event after it runs.

Props Dharm1025, jrf.
Fixes #35968.



git-svn-id: https://develop.svn.wordpress.org/trunk@43608 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 04:03:10 +00:00
Peter Wilson
e686ac1f67 Twenty Sixteen: Add pre-connect resource hint for Google Fonts.
When using Google Fonts, pre-connect to https://fonts.gstatic.com to improve the performance downloading the webfont files.

Props westonruter.
Fixes #44668.


git-svn-id: https://develop.svn.wordpress.org/trunk@43606 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-03 00:52:53 +00:00
Sergey Biryukov
04516c1299 Taxonomy: Make sure wp_list_categories() correctly outputs term name of 0.
Props joyously, SergeyBiryukov.
Fixes #44872.

git-svn-id: https://develop.svn.wordpress.org/trunk@43605 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-02 22:08:05 +00:00
Rachel Baker
f93c771fc9 REST API: Load missing required file for multisite users in WP_REST_Attachments_Controller::create_item().
Requires wp-admin/includes/image.php to make `wp_read_image_metadata()` function available. Fixes error introduced in [43589].

Props ocean90, soulseekah.
Fixes #43757.

git-svn-id: https://develop.svn.wordpress.org/trunk@43604 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-31 23:45:17 +00:00
Rachel Baker
324d440c7a REST API: Load missing required file for multisite users in WP_REST_Attachments_Controller::check_upload_size().
Requires wp-admin/includes/ms.php to make `upload_is_user_over_quota()` function available to multisite users uploading files.

Props JakePT, rachelbaker.
Fixes #44864.

git-svn-id: https://develop.svn.wordpress.org/trunk@43603 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-31 23:25:39 +00:00
John Blackbourn
2eb9362782 Media: Ensure the "Edit more details" link in the attachment details modal always points to the correct editing URL.
Fixes #44620


git-svn-id: https://develop.svn.wordpress.org/trunk@43601 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-31 10:51:00 +00:00
Sergey Biryukov
9db8106f92 Docs: Convert @see reference in wp_checkdate() DocBlock to @link.
Props WiZZarD_.
Fixes #44866.

git-svn-id: https://develop.svn.wordpress.org/trunk@43599 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 13:48:50 +00:00
jrf
1730443206 I18n: Improve translators comments [3].
* Add missing translators comments.
* Fix placement of some translators comments.
  Translators comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools.
  The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translators comments.

Includes minor code layout fixes.

Patch `44360-wp-admin-includes-dir.patch` of the series.

Props flipkeijzer, alvarogois, michielatyoast
See #44360


git-svn-id: https://develop.svn.wordpress.org/trunk@43598 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 13:35:27 +00:00
Sergey Biryukov
a0ae2c5d85 Embeds: After [43593], move the new check to a separate line to avoid test_js_no_ampersands_in_compiled failure caused by UglifyJS task.
See #44832.

git-svn-id: https://develop.svn.wordpress.org/trunk@43597 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 12:39:07 +00:00
jrf
0b4334c5e3 I18n: Improve translators comments [2].
* Add missing translators comments.
* Fix placement of some translators comments.
  Translators comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools.
  The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translators comments.

Patch `44360.wp-includes_customize.3.patch` of the series.

Props marcomartins, mihaiiceyro, michielatyoast
See #44360


git-svn-id: https://develop.svn.wordpress.org/trunk@43596 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 12:35:08 +00:00
jrf
7839cf651f I18n: Improve translators comments [1].
* Add missing translators comments.
* Fix placement of some translators comments.
  Translators comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools.
  The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translators comments.

Patch `44360-src.2.diff` of the series.

Props garyj, alvarogois, michielatyoast
See #44360

git-svn-id: https://develop.svn.wordpress.org/trunk@43595 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 12:13:53 +00:00
Sergey Biryukov
f1862cd98c Date/Time: Make sure current_time() always calculates the offset from GMT/UTC.
Previously, UTC context was implied, but could be unreliable due to being affected by plugins.

Props Rarst, rahulsprajapati, marco.marsala.
Fixes #37440.

git-svn-id: https://develop.svn.wordpress.org/trunk@43594 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 12:12:55 +00:00
Sergey Biryukov
c1b7284c4b Embeds: Avoid a JS error in wp.receiveEmbedMessage if data parameter is not set.
Props dsifford, kadamwhite.
Fixes #44832.

git-svn-id: https://develop.svn.wordpress.org/trunk@43593 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 10:29:03 +00:00
Sergey Biryukov
8eebd125f0 Post Formats: Don't assign a variable inside if statement in get_post_format().
Props Mirucon.
Fixes #44840.

git-svn-id: https://develop.svn.wordpress.org/trunk@43592 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 09:00:42 +00:00
Sergey Biryukov
9364b6ed87 Date/Time: Make get_the_date() call get_post_time() for consistency with get_the_time().
Props Rarst.
Fixes #44490.

git-svn-id: https://develop.svn.wordpress.org/trunk@43591 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-30 08:49:40 +00:00
Jeremy Felt
ded817edd5 Multisite: Display registered new_item text for post post type in My Sites menu.
Previously, the My Sites menu would show "New Post" even if the `post` post type labels had been filtered to different values.

Props nahuelmahe.
Fixes #44794.


git-svn-id: https://develop.svn.wordpress.org/trunk@43590 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-29 15:50:00 +00:00
Rachel Baker
24248a44b9 REST API: Limit the scope of wp-admin files required in WP_REST_Attachments_Controller methods.
Narrow the scope of the included wp-admin files loaded for `wp_generate_attachment_metadata()`, `wp_handle_upload()`, `wp_tempnam()`, and `wp_handle_sideload()`. Requires only wp-admin/includes/file.php and wp-admin/includes/image.php instead of wp-admin/includes/admin.php. 

Props lonelyvegan, soulseekah, pratikthink.
Fixes #43757.

git-svn-id: https://develop.svn.wordpress.org/trunk@43589 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-29 03:22:14 +00:00
Felix Arntz
f98b266303 Customize: Ensure that only sidebar sections are considered when comparing against sidebars.
In the Customizer a notice will show up if there is at least one registered sidebar with its section not being active. In order to achieve that, the count of registered sidebars is compared to the count of active sections in the Widgets panel. Prior to this change, the latter would incorrectly include any sections, even additional sections that do not correspond to a sidebar.

Fixes #43556.


git-svn-id: https://develop.svn.wordpress.org/trunk@43588 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-28 19:54:29 +00:00
Felix Arntz
b0c83c8ee7 General: Provide context parameters to doing_it_wrong_trigger_error filter.
`$function`, `$message`, and `$version` have historically been passed to the `doing_it_wrong_run` action. It makes sense to pass those to the filter as well, so that one can conditionally determine the filter value to return.

Fixes #34183.


git-svn-id: https://develop.svn.wordpress.org/trunk@43587 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-28 13:37:26 +00:00
Felix Arntz
aa5b179247 REST API: Fix failing tests after [43584] and [43585].
See #40510.


git-svn-id: https://develop.svn.wordpress.org/trunk@43586 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-28 13:04:07 +00:00
Felix Arntz
65cadaab62 REST API: Fix failing tests after [43584].
See #40510.


git-svn-id: https://develop.svn.wordpress.org/trunk@43585 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-28 12:43:50 +00:00
Felix Arntz
e5d6ddfeee REST API: Support pagination, order, search and other common query parameters for revisions.
The original REST API revisions controller relied on `wp_get_post_revisions()`, getting all revisions of a post without any possibility to restrict the result. This changeset replaces that function call with a proper `WP_Query` setup, replicating how `wp_get_post_revisions()` works while offering parameters to alter the default behavior.

Props adamsilverstein, birgire, flixos90.
Fixes #40510.


git-svn-id: https://develop.svn.wordpress.org/trunk@43584 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-28 12:22:48 +00:00
John Blackbourn
ecf24cd572 Docs: Improve inline documentation for WP_Scripts.
Props desrosj

See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43583 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-27 14:33:35 +00:00
John Blackbourn
5af7160563 Docs: Correct and improve various inline documentation.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43582 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-27 14:27:22 +00:00
Andrew Ozz
28dcba340c TinyMCE: remove stray CSS map reference from skin.min.css.
Props: pross.
Fixes #44785.

git-svn-id: https://develop.svn.wordpress.org/trunk@43581 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-20 15:08:15 +00:00
Andrew Ozz
fa35f06219 Script loader: remove (PHP based) compression from load-styles.php and load-scripts.php. WIth the amount of scripts and stylesheets grown a lot over the years, it has become pretty slow and consumes a lot of server resources. Also, most servers are set to compress PHP output anyway.
Props LucasRolff, azaozz.

Fixes #44815.
See #43308.

git-svn-id: https://develop.svn.wordpress.org/trunk@43580 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-20 13:50:49 +00:00
Andrew Ozz
9d6176e3c9 Reorder quicktags.js a bit to account for the order of defining vars and functions after [43577].
See #44371.

git-svn-id: https://develop.svn.wordpress.org/trunk@43579 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-20 13:33:59 +00:00
Felix Arntz
1e4e60f11c Customize: Safeguard a check on the customize_validate_{$setting_id} filter value to ensure it is a WP_Error.
While the filter is documented to only support a `WP_Error`, it has been a common practice to return true in a validation function if no errors have occurred. This was already caught when the same filter was executed in `WP_Customize_Setting`, it was however missing in `WP_Customize_Manager::validate_setting_values()`.

Fixes #44809.


git-svn-id: https://develop.svn.wordpress.org/trunk@43578 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-19 16:37:12 +00:00
Omar Reiss
8347d7e22f General: Explicitly assigns all JS globals to the window.
Many variables in the JavaScript were defined in the global scope without being explicitly assigned to the window. When built with Webpack, the code gets encapsulated in anonymous functions and those implicit globals get assigned to the wrong scope. This patch prevents that from happening.

Fixes #44371. See #43731.


git-svn-id: https://develop.svn.wordpress.org/trunk@43577 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-19 13:32:27 +00:00
John Blackbourn
7d54198c7c Docs: Remove an erroneous closing brace from the description of wp_list_pages().
Props birgire

See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43576 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-19 11:16:59 +00:00
John Blackbourn
8454fd7918 Customize: Increase the colour contrast of the line numbers in CodeMirror.
Props earnjam, abdullahramzan, audrasjb, Luminus

Fixes #44763


git-svn-id: https://develop.svn.wordpress.org/trunk@43574 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-19 11:00:46 +00:00
Sergey Biryukov
8bbae6aeb1 Administration: Remove $title_class variable, unused since [18683].
Props hitendra-chopda, torontodigits.
Fixes #44812.

git-svn-id: https://develop.svn.wordpress.org/trunk@43573 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-19 10:17:50 +00:00
Gary Pendergast
63acd3caaa Tests: Revert wp-api-generated.js change added in [43571].
The fixtures file was accidentally included in [43571], but that caused other tests to fail.

See #39122.



git-svn-id: https://develop.svn.wordpress.org/trunk@43572 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 04:11:48 +00:00
Gary Pendergast
a75d153eee Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
Boone Gorges
fed48ba3fe Introduce wp_insert_term_duplicate_term_check filter.
This filter allows plugins to intervene in the duplicate-term check
that takes place at the time of term creation. See [30238], #22023.

Props strategio.
Fixes #43271.

git-svn-id: https://develop.svn.wordpress.org/trunk@43570 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-15 19:49:50 +00:00
Gary Pendergast
cb3d1777b1 Coding Standards: Prepare for upgrading WPCS to 1.0.0.
In order to get the best result when running `phpcbf` across the codebase, there are some manual tweaks we need to make.

These fall into three categories:
- Fixing incorrectly indented code which has flow-on effects when auto-fixing.
- Tweaking the layout of inline PHP inside HTML tags.
- Moving more complex inline PHP inside HTML tags, to execute earlier.

See #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43569 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-15 06:22:00 +00:00
Sergey Biryukov
c5d013bf95 Privacy: Ensure the user request email is sent in the requested user's locale (or the site's default locale if they are not a registered user) when the administrator creating the request uses a different locale.
Props desrosj, Chouby, iandunn, lbenicio, birgire, earnjam, swissspidy, garrett-eclipse.
Fixes #43985.

git-svn-id: https://develop.svn.wordpress.org/trunk@43568 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-13 16:31:31 +00:00
K. Adam White
20ab5ca79e Tests: Improve coverage for REST API term meta registration.
Introduce tests to validate that register_meta and register_term_meta work as expected in WP_REST_Terms_Controller.

props timmydcrawford.
Fixes #39122.


git-svn-id: https://develop.svn.wordpress.org/trunk@43567 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-12 00:05:39 +00:00
K. Adam White
245fb8e9b0 REST API: generate a valid fallback URI in wp.api.utils.getRootURL.
When window.location.origin isn't set, correctly insert two slashes between the protocol and host when constructing the fallback URL.

props abdullahramzan.
Fixes #44764.


git-svn-id: https://develop.svn.wordpress.org/trunk@43566 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-11 18:50:23 +00:00
Sergey Biryukov
244f435e22 Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.
See [36550] for `WP_Styles`.

Props bpayton.
Fixes #44551.

git-svn-id: https://develop.svn.wordpress.org/trunk@43565 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-11 17:41:29 +00:00
Sergey Biryukov
cbf8f438d7 Script/Style Dependencies: Simplify some logic in WP_Styles::do_item().
Combine repetitive assignments, make the code more consistent with `WP_Scripts::do_item()`.

See #44551.

git-svn-id: https://develop.svn.wordpress.org/trunk@43564 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-11 17:41:02 +00:00