Commit Graph

14310 Commits

Author SHA1 Message Date
Jonathan Desrosiers
c0e80b028a REST API: Enable users with read_private_posts to query for them.
An authorized request with the read_private_posts capability for a post type should be able to GET /wp/v2/posts for posts of status=private. This query is further sanity-checked by WP_REST_Posts_Controller->check_read_permission(), which is unchanged.

Props rachelbaker, soulseekah, twoelevenjay.

Moves [43694] from the 5.0 branch to trunk.

Fixes #43701.

git-svn-id: https://develop.svn.wordpress.org/trunk@43979 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-11 22:29:36 +00:00
Aaron Jorbin
7ec7fadfe7 PHPCS: Fix errors
Fix errors introduced in [43973] due to Jorbin not running the correct tag of wpcs.

Unprops jorbin.



git-svn-id: https://develop.svn.wordpress.org/trunk@43976 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-11 04:44:16 +00:00
Aaron Jorbin
7f544b912b REST API: Declare unfiltered_html capability in links.
Because user capabilities can be modified at runtime, the REST API needs to expose them in some evaluated but declarative manner for clients to interpret. JSON Hyper Schema targetSchema provides an appropriate paradigm for doing so.

Merges [43682] to trunk.

Props timothyblynjacobs.

Fixes #45014.


git-svn-id: https://develop.svn.wordpress.org/trunk@43974 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-11 04:12:56 +00:00
Aaron Jorbin
891394af73 REST API: Persist attributes for attachment links
In [43437], the link definition implementation caused attachment links to be unexpectedly nested under an attributes key. This changeset restores the prior behavior.

Merges [43681] to trunk.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44750.


git-svn-id: https://develop.svn.wordpress.org/trunk@43973 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-11 04:00:37 +00:00
Gary Pendergast
ddc67854a4 Bump trunk version to 5.1-alpha.
git-svn-id: https://develop.svn.wordpress.org/trunk@43677 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-05 20:19:12 +00:00
Mel Choyce
cd574077c8 List Table: Fix formatting issue introduced in r43671.
Props dd32.
See #45028.


git-svn-id: https://develop.svn.wordpress.org/trunk@43672 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-03 21:11:16 +00:00
Mel Choyce
29e8c152f1 List Table: Restore the List Table items property to allow Bulk Actions to be properly determined.
This fixes the display of Bulk Actions where there exists only a single page of results.

Props shaneeckert, jobthomas, dd32.
Fixes #45028.


git-svn-id: https://develop.svn.wordpress.org/trunk@43671 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-03 19:46:51 +00:00
Mel Choyce
cec0385656 List Tables: Arrange action items into a grid with extra space.
On small screens, list table actions were cramped. This makes it easy to press the wrong action by mistake. The items are now arranged into a grid and given extra room to create a larger tap-target.

The plugins list table was excluded because it's current layout doesn't match the others, and we should add more space to this in a future commit.

Props jobthomas, ryelle.
Fixes #45024.


git-svn-id: https://develop.svn.wordpress.org/trunk@43670 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-03 18:55:35 +00:00
Gary Pendergast
1f4ed43c65 Plugin Installer: Allow 4 columns of search results on wide screens.
For screens wider than 2300px, show 4 colums of search results, as 3 columns looked quite stretched out.

This change also increases the default number of search results from 30 to 36, so that the columns have an even number of results, regardless of whether there are 2, 3, or 4 of them.

Props nielslange.
Fixes #43573.



git-svn-id: https://develop.svn.wordpress.org/trunk@43669 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 20:06:37 +00:00
Gary Pendergast
9bdb0eb1d5 i18n: Improve consistency of translator comments.
Props ramonopoly.
Fixes #44998.



git-svn-id: https://develop.svn.wordpress.org/trunk@43668 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 19:50:48 +00:00
Gary Pendergast
53264d2463 Plugins: Pluralise the "unexpected output during activation" message.
When a plugin is activated, it can trigger a warning message if it outputs data at that time. This error message was being run through `__()`, instead of `_n()`, so it wasn't possible to correctly pluralise the message.

Props jamosova.
Fixes #42355.



git-svn-id: https://develop.svn.wordpress.org/trunk@43667 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 19:29:18 +00:00
Gary Pendergast
456e243224 Taxonomies: Improve description of default category behaviour.
Add some extra information to the Categories list screen, explaining why the default category doesn't have a Delete button.

Props Codestor.
Fixes #44961.



git-svn-id: https://develop.svn.wordpress.org/trunk@43666 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 19:18:58 +00:00
Gary Pendergast
2b49d4660b Docs: Replace incorrect usage of "who's" with "whose".
Whom can say who's "whose" is who's? Is it a Who that Horton heard? Maybe it's The Who whose "who" knowledge will hook whomever hoots "who's" instead of "whose".

Hoot. Hoot.

Props Hafiz.
Fixes #45026.



git-svn-id: https://develop.svn.wordpress.org/trunk@43665 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 16:22:46 +00:00
Gary Pendergast
ad1f484317 Posts: Remove the slug from Quick Edit for CPTs with publicly_queryable disabled.
In the full edit screen, CPTs that have disabled the `publicly_queryable` option will hide the slug field, as it doesn't need to be edited. This change brings the Quick Edit view into line with that behaviour.

Props bhargavmehta, krutidugade.
Fixes #43278.



git-svn-id: https://develop.svn.wordpress.org/trunk@43664 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-02 15:52:15 +00:00
Gary Pendergast
75c7cb5acf Taxonomy: Remove the "Note" label from the notes on the Category edit list.
There are notes on both the Tag and Category pages, but only the latter prefixes it with a "Note" label.

Props joanrho, pratikthink, jainnidhi.
Fixes #43800.



git-svn-id: https://develop.svn.wordpress.org/trunk@43663 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-01 21:55:33 +00:00
Gary Pendergast
a386f726da Docs: Add a file header comment to version.php.
Props sephsekla, bruceallen.
Fixes #43765.



git-svn-id: https://develop.svn.wordpress.org/trunk@43662 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-01 20:59:26 +00:00
Sergey Biryukov
a2017354e2 Docs: Document that the $src parameter of WP_Dependencies::add() can be boolean.
Props dimadin.
Fixes #45009.

git-svn-id: https://develop.svn.wordpress.org/trunk@43661 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-28 21:50:45 +00:00
Sergey Biryukov
c2ab97264d Users: Pass the current WP_User_Query instance to found_users_query filter.
Props spacedmonkey.
Fixes #43679.

git-svn-id: https://develop.svn.wordpress.org/trunk@43660 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 22:53:12 +00:00
Sergey Biryukov
45efe978fc Twenty Seventeen: Use a simple counter incremented with each call instead of uniqid() for generating unique IDs for HTML elements.
Props westonruter.
Fixes #44883.

git-svn-id: https://develop.svn.wordpress.org/trunk@43659 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 20:56:59 +00:00
Sergey Biryukov
e1ff4cd7cd General: Introduce wp_unique_id(), a PHP implementation of Underscore's uniqueId method.
A static variable contains an integer that is incremented with each call. This number is returned with the optional prefix.
As such the returned value is not universally unique, but it is unique across the life of the PHP process.

Props westonruter, dlh.
See #44883.

git-svn-id: https://develop.svn.wordpress.org/trunk@43658 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 20:56:30 +00:00
Sergey Biryukov
75a5293460 Docs: Add a line break to wp_is_uuid() DocBlock for better readability.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@43657 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 20:45:01 +00:00
Felix Arntz
c12a0cf4f3 Multisite: Fix coding standard errors after [43654].
See #41333.


git-svn-id: https://develop.svn.wordpress.org/trunk@43655 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 15:22:01 +00:00
Felix Arntz
1795dbe25a Multisite: Introduce a site initialization and uninitialization API.
This changeset makes the new CRUD API for sites introduced in [43548] usable for real-world sites. A new function `wp_initialize_site()`, which takes care of creating a site's database tables and populating them with initial values, is hooked into the site insertion process that is initiated when calling `wp_insert_site()`. Similarly, a new function `wp_uninitialize_site()`, which takes care of dropping a site's database tables, is hooked into the site deletion process that is initiated when calling `wp_delete_site()`.

A new function `wp_is_site_initialized()` completes the API, allowing to check whether a site is initialized. Since this function always makes a database request in its default behavior, it should be called with caution. Plugins that would like to use site initialization in special ways can leverage a `pre_wp_is_site_initialized` filter to alter that default behavior.

The separate handling of the site's row in the `wp_blogs` database table and the actual site setup allows for more flexibility in controlling whether or how a site's data is set up. For example, a unit test that only checks data from the site's database table row can unhook the site initialization process to improve performance. At the same time, developers consuming the new sites API only need to know about the CRUD functions, since the initialization and uninitialization processes happen internally.

With this changeset, the foundation for a sites REST API endpoint is fully available. The previously recommended functions `wpmu_create_blog()` and `wpmu_delete_blog()` now call the new respective function internally. Further follow-up work to this includes replacing calls to `wpmu_create_blog()` with `wp_insert_site()`, `update_blog_details()` with `wp_update_site()` and `wpmu_delete_blog()` with `wp_delete_blog()` throughout the codebase.

As a side-effect of this work, the `wpmu_new_blog`, `delete_blog`, and `deleted_blog` actions and the `install_blog()` function have been deprecated.

Fixes #41333. See #40364.


git-svn-id: https://develop.svn.wordpress.org/trunk@43654 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-24 15:08:32 +00:00
Aaron Jorbin
6604782cd9 General: PHP7.3 throws an E_WARNING when using continue to target a switch
Applying continue to a switch is equivalent to using break and quite possibly, a continue targeting a higher level control structure is actually intended.

To target the higher level control structure, a numeric argument has to be passed to continue. This fixes two cases in WordPress Core where this is currently happening.

See: https://github.com/php/php-src/pull/3364
See: https://wiki.php.net/rfc/continue_on_switch_deprecation

Props jrf.
Fixes #44543.



git-svn-id: https://develop.svn.wordpress.org/trunk@43653 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-23 22:49:02 +00:00
Sergey Biryukov
33074d8c67 Users: Add LIMIT 1 to SQL query in WP_User::get_data_by(), as only one row is requested.
Props spacedmonkey.
Fixes #43692.

git-svn-id: https://develop.svn.wordpress.org/trunk@43651 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-23 15:32:48 +00:00
Sergey Biryukov
e9eaabaf14 Upgrade/Install: Adjust table prefix string check in setup-config.php for the coding standards change in [42343].
Props shashwatmittal, allendav.
Fixes #44318.

git-svn-id: https://develop.svn.wordpress.org/trunk@43650 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-20 05:14:21 +00:00
John Blackbourn
3493feaa5a Docs: Improve docblocks within wp-login.php.
Props birgire

See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43644 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-14 13:47:01 +00:00
John Blackbourn
948a5ef28b Docs: Correct and improve docblocks for user session management functionality.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43643 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-14 13:44:50 +00:00
John Blackbourn
b2374bf1ad Docs: Correct and improve some docblocks.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@43642 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-14 13:34:50 +00:00
Sergey Biryukov
df261c632a Docs: Correct @since value for _wp_privacy_statuses().
Fix typo in `@since` entry for `WP_Privacy_Policy_Content:add()`.

Props dimadin.
Fixes #44915.

git-svn-id: https://develop.svn.wordpress.org/trunk@43638 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-13 10:19:28 +00:00
K. Adam White
e29d895ffd REST API: Pass correct ID to meta->update_value to permit setting term meta during term creation.
Props joehoyle.
Fixes #44834.



git-svn-id: https://develop.svn.wordpress.org/trunk@43636 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-12 23:55:47 +00:00
Dominik Schilling (ocean90)
82bf9baa32 I18N: In the POMO library, replace chr() calls for static values with their string representation.
Props ccismaru, ocean90.
Fixes #17128.

git-svn-id: https://develop.svn.wordpress.org/trunk@43635 602fd350-edb4-49c9-b593-d223f7449a82
2018-09-12 06:10:42 +00:00
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
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
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
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
Sergey Biryukov
b87cc1ceb9 Docs: Correct description for WP_Scripts::$default_version.
See #42505.

git-svn-id: https://develop.svn.wordpress.org/trunk@43563 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-11 15:08:23 +00:00
Sergey Biryukov
28a6760634 Customize: Pass missing parameter to dynamic option_{$option} filter in WP_Customize_Widgets::capture_filter_pre_get_option().
Props dlh.
Fixes #44770.

git-svn-id: https://develop.svn.wordpress.org/trunk@43561 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-11 12:44:22 +00:00
Rachel Baker
7e879f48f1 Docs: Update $meta_type descriptions to include ’term’ as a valid type in meta.php and class-wp-term-query.php.
Props macbookandrew.
Merges [43557] to trunk.
Fixes #44751.


git-svn-id: https://develop.svn.wordpress.org/trunk@43560 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-08 21:44:31 +00:00
Boone Gorges
ed2fff61d7 Correct param documentation for WP_Term_Query.
The description of `$meta_type` introduced in [40053] was incorrect.

Props dlh.
Fixes #44608.

git-svn-id: https://develop.svn.wordpress.org/trunk@43559 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-08 19:22:39 +00:00
Boone Gorges
90a3ab5f80 Taxonomy: Introduce new hooks when registering/unregistering taxonomies for object types.
Props soulseekah.
Fixes #44733.

git-svn-id: https://develop.svn.wordpress.org/trunk@43558 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-08 19:14:08 +00:00
obenland
c52e7c79b2 Toolbar: Check if obj is set before using it.
Props pento.
See #44526.


git-svn-id: https://develop.svn.wordpress.org/trunk@43556 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-06 19:32:12 +00:00
laurelfulford
49a6596d7e Twenty Seventeen: Correct date in changelog for 4.9.8 release.
Props pbiron, laurelfulford.
Fixes #44646.



git-svn-id: https://develop.svn.wordpress.org/trunk@43550 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-02 15:32:26 +00:00
Sergey Biryukov
e26a5d64d1 Docs: Correct parameter name in strip_shortcodes_tagnames filter DocBlock.
Props uttam007.
Fixes #44691.

git-svn-id: https://develop.svn.wordpress.org/trunk@43549 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-02 15:12:56 +00:00
Felix Arntz
c29d019762 Multisite: Complete the new CRUD API for managing sites.
New functions `wp_insert_site( $data )`, `wp_update_site( $id, $data )` and `wp_delete_site( $id )` are introduced to manage site rows in the `wp_blogs` table, forming the new CRUD API together with the existing `get_site()` / `get_sites()`. The new API provides various benefits over the previously existing API, fixing several cache invalidation issues and being hook-driven so that normalization and validation of the passed data can be fully customized.

New hooks introduced as part of this are the actions `wp_insert_site`, `wp_update_site`, `wp_delete_site`, `wp_validate_site_data` and the filter `wp_normalize_site_data`.

At this point, `wp_insert_site()` does not handle setting up the site's database tables, and `wp_delete_site()` does not handle dropping the site's database tables, so the two can not yet be used directly as full replacements of `wpmu_create_blog()` and `wpmu_delete_blog()`. Managing the site's database tables will be added via hooks as part of the follow-up ticket #41333.

The existing functions `wpmu_create_blog()`, `update_blog_details()`, and `wpmu_delete_blog()` make use of the respective new counterpart and will be obsolete once #41333 has been completed.

Props flixos90, jeremyfelt, spacedmonkey.
Fixes #40364.


git-svn-id: https://develop.svn.wordpress.org/trunk@43548 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-01 13:05:44 +00:00
Aaron Jorbin
df9dd119a5 Gutenbeg: you can't remove call outs that don't exist
This commit should have just gone into the 4.9 branch. It did in [43544].

See: #44680
Unprops jorbin
props ocean90


git-svn-id: https://develop.svn.wordpress.org/trunk@43545 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-31 15:15:31 +00:00
Aaron Jorbin
8ed24bbbda Gutenberg: Restrict "Try Gutenberg" based on capability and gutenstatus
When Gutenberg is either not installed, or not activated, only show the callout to users with the install_plugins capability.
When Gutenberg is activated, expand that to include all users with the edit_posts capability.

Props pento.
Fixes #44680.


git-svn-id: https://develop.svn.wordpress.org/trunk@43543 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-31 14:41:46 +00:00
John Blackbourn
ae69878202 Login and Registration: Pass the $errors parameter to the lost_password action.
Props sebakurzyn

Fixes #44512


git-svn-id: https://develop.svn.wordpress.org/trunk@43542 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-28 13:01:30 +00:00
laurelfulford
a3dcfa9f91 Twenty Seventeen: Bump version number and update changelog for 4.9.8 release.
Props pbiron.
Fixes #44646.


git-svn-id: https://develop.svn.wordpress.org/trunk@43541 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-27 18:36:35 +00:00
Peter Wilson
a32ea2d35d Cron: Add hooks and a function to allow hijacking cron implementation.
This allows sites with a large cron option or a custom cron implementation to hijack the cron option to store cron data using custom functionality.

`wp_get_scheduled_event()` is new function to retrieve the event object for a given event based on the hook name, arguments and timestamp. If no timestamp is specified the next occurence is returned.

Preflight filters are added to all functions that read from or modify the cron option: `pre_schedule_event`, `pre_reschedule_event`, `pre_unschedule_event`, `pre_clear_scheduled_hook`, `pre_unschedule_hook`, `pre_get_scheduled_event` and `pre_next_scheduled`.

Additionally, the post scheduling hooks `next_scheduled` and `get_schedule` to allow plugins to modify an event after retrieving it from WordPress.

Props rmccue, DavidAnderson, ethitter, peterwilsoncc.
Fixes #32656.



git-svn-id: https://develop.svn.wordpress.org/trunk@43540 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-27 02:22:50 +00:00
Sergey Biryukov
927cd42632 Posts, Post Types: Introduce edit_post_{$post->post_type} hook.
The hook fires before the general `edit_post` hook and has the same parameters.

It also complements the `save_post_{$post->post_type}` hook added in [25050].

Props Mte90, garrett-eclipse.
Fixes #34706.

git-svn-id: https://develop.svn.wordpress.org/trunk@43535 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-25 20:56:39 +00:00
Sergey Biryukov
ddc8f803c6 Privacy: Revert [43525].
The commenter cookies checkbox is not legally required, so should be disabled by default.

Fixes #44373.

git-svn-id: https://develop.svn.wordpress.org/trunk@43531 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 17:05:56 +00:00
Sergey Biryukov
0f7e947546 REST API: Ensure attachments created with WP_REST_Attachments_Controller::create_item() on Windows have a relative path.
Props ocean90, SergeyBiryukov, redcastor.
Fixes #40861.

git-svn-id: https://develop.svn.wordpress.org/trunk@43529 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 16:51:09 +00:00
Sergey Biryukov
6c32fcd011 I18N: Separate two "About" strings with different context.
Props desrosj, XpertOne, Nao.
Fixes #44139.

git-svn-id: https://develop.svn.wordpress.org/trunk@43527 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 15:03:19 +00:00
Sergey Biryukov
335b69cedc Privacy: Remove the setting to enable comment cookies consent added in [43469].
This needs some more work to ensure expected behaviour.

See #44373.

git-svn-id: https://develop.svn.wordpress.org/trunk@43525 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 12:50:55 +00:00
K. Adam White
3aba622692 Docs: Add $object_subtype param documentation for sanitize_meta().
Props timothyblynjacobs.

See #38323.


git-svn-id: https://develop.svn.wordpress.org/trunk@43521 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-23 17:13:40 +00:00
K. Adam White
9fd092fb71 Docs: Update @since version to 4.9.8 for meta registration subtype handling.
This feature has been backported to 4.9.8 so 5.0.0 is inaccurate.

See #38323.


git-svn-id: https://develop.svn.wordpress.org/trunk@43520 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-23 17:01:02 +00:00
John Blackbourn
796bac8645 Docs: Correct the parameter type for WP_REST_Post_Types_Controller::prepare_item_for_response().
Props subrataemfluence

Fixes #44437


git-svn-id: https://develop.svn.wordpress.org/trunk@43519 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-22 12:25:48 +00:00
Sergey Biryukov
8a0aac2ccb Comments: Ensure that themes overriding default comment_form() fields still display the cookies consent checkbox.
The `comment_form_default_fields` filter can be used to remove the checkbox.

Props pross, SergeyBiryukov.
Fixes #44126.

git-svn-id: https://develop.svn.wordpress.org/trunk@43518 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-20 00:37:40 +00:00
obenland
9d4b0ec88f Toolbar: Fail gracefully when adding events to non-existent elements
Avoids a type error when `obj` is not set.

Fixes #44526.


git-svn-id: https://develop.svn.wordpress.org/trunk@43517 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-19 21:59:23 +00:00
Sergey Biryukov
e7d9ee5051 Privacy: Improve grammar on Privacy Settings screen.
Props ianbelanger, garrett-eclipse.
Fixes #44612.

git-svn-id: https://develop.svn.wordpress.org/trunk@43513 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-19 20:13:29 +00:00
Sergey Biryukov
ffdc5e6827 Privacy: Use a consistent case for "Privacy Policy page" on Privacy Settings screen.
Props XpertOne, idea15, garrett-eclipse.
Fixes #44130.

git-svn-id: https://develop.svn.wordpress.org/trunk@43508 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-19 12:09:31 +00:00
Sergey Biryukov
a1f6ba5477 Privacy: Use the actual Privacy Policy page title in get_the_privacy_policy_link().
Props desrosj, birgire, ianbelanger, Ov3rfly.
Fixes #44192.

git-svn-id: https://develop.svn.wordpress.org/trunk@43506 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-18 11:49:46 +00:00
Sergey Biryukov
7e4f59b28e I18N: Update list of continents and cities for the timezone selection.
Props soulseekah, dyrer.
Fixes #44574.

git-svn-id: https://develop.svn.wordpress.org/trunk@43504 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-18 11:20:28 +00:00
Sergey Biryukov
df7b163a31 Privacy: Mark Privacy Policy page as such in the Pages list table.
Props desrosj, subrataemfluence, ianbelanger, danieltj.
Fixes #44006.

git-svn-id: https://develop.svn.wordpress.org/trunk@43495 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:45:04 +00:00
Sergey Biryukov
a8b83cf91a Twenty Seventeen: Correct list item style for nested unordered lists.
Props macbookandrew, audrasjb.
Fixes #44109.

git-svn-id: https://develop.svn.wordpress.org/trunk@43493 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:34:57 +00:00
Sergey Biryukov
121215092c Docs: Change @since entry for WP_Term_Query::populate_terms() added in [43049] to 4.9.8.
See #42691.

git-svn-id: https://develop.svn.wordpress.org/trunk@43491 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:24:35 +00:00
Sergey Biryukov
f75b58113d Privacy: Enable pagination screen options for privacy requests list tables.
Props birgire, pbiron.
Fixes #44025.

git-svn-id: https://develop.svn.wordpress.org/trunk@43486 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 16:03:59 +00:00
Andrew Ozz
590d18844b Customize: Do not attempt to count uncountable value.
Props dlh.
Fixes #44104.

git-svn-id: https://develop.svn.wordpress.org/trunk@43480 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 14:37:21 +00:00
Sergey Biryukov
d25cf1c907 Privacy: Rename username_or_email_to_export POST variable on Erase Personal Data screen to a more generic username_or_email_for_privacy_request.
Props ianbelanger, allendav.
Fixes #44181.

git-svn-id: https://develop.svn.wordpress.org/trunk@43478 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 14:14:47 +00:00
Andrew Ozz
7a86b55763 Privacy: Add $request to $email_data to make it available to all filters.
Props desrosj.
Fixes #44379.

git-svn-id: https://develop.svn.wordpress.org/trunk@43477 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 13:52:43 +00:00
Andrew Ozz
6612d0e452 Privacy: Add filter for the subject of the erasure complete notification emails.
Props desrosj.
Fixes #44265.

git-svn-id: https://develop.svn.wordpress.org/trunk@43475 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 13:41:33 +00:00
Andrew Ozz
d8869384be Privacy: Add a setting to disable comment cookie consent.
Fixes #44373.

git-svn-id: https://develop.svn.wordpress.org/trunk@43469 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 09:07:29 +00:00
Andrew Ozz
b33deaf1b5 Privacy: Don't replace comment author URL and email with anything.
Props TZ-Media, desrosj, birgire.
Fixes #44141.

git-svn-id: https://develop.svn.wordpress.org/trunk@43467 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 08:59:30 +00:00
Gary Pendergast
6c8c2aeaf9 Streams: Return early from wp_is_stream() for paths that aren't streams.
Some versions of PHP appear to have a memory leak that is occasionally triggered by calling `stream_get_wrappers()`. In order to avoid calling this, we can return early from `wp_is_stream()` when `$path` doesn't contain `://`.

Props pbiron, JPry, dontstealmyfish.
Fixes #44532.



git-svn-id: https://develop.svn.wordpress.org/trunk@43466 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:53:18 +00:00
Gary Pendergast
8c55028c90 Privacy: Remove some unnecessary code comments.
[42967] introduced some WPCS-related comments, probably accidentally saved by an IDE.

Props burhandodhy.
Fixes #44590.



git-svn-id: https://develop.svn.wordpress.org/trunk@43465 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:42:23 +00:00
Gary Pendergast
93af027510 Editor: Use apply_filters_deprecated() for some deprecated filters.
The `htmledit_pre` and `richedit_pre` filters have been deprecated since 4.3.0, since before `apply_filters_deprecated()` existed. They're now correctly run using `apply_filters_deprecated()`.

Props sebastienthivinfocom, lbenicio, ianbelanger.
Fixes #44341.



git-svn-id: https://develop.svn.wordpress.org/trunk@43464 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:37:29 +00:00
Gary Pendergast
98fd60fc67 REST API: Fix some incorrect @since tags.
[43437] included some new methods, which were incorrectly tagged as being `@since 4.9.7`. This updates them to `4.9.8`.

Props danielbachhuber.
Fixes 44287.



git-svn-id: https://develop.svn.wordpress.org/trunk@43463 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:26:20 +00:00
Gary Pendergast
66f537e702 REST API: Attachments controller should respect upload limits.
When the REST API is in use on WordPress multisite, the `WP_REST_Attachments_Controller` should respect the "Max upload file size" and "Site upload space" site options.

Props flixos90, danielbachhuber.
Fixes #43751.



git-svn-id: https://develop.svn.wordpress.org/trunk@43462 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 07:21:50 +00:00
Sergey Biryukov
018779aca1 Docs: Change @since entry for add_inline_data action added in [42676] to 4.9.8.
See #36085.

git-svn-id: https://develop.svn.wordpress.org/trunk@43460 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 15:26:57 +00:00
Sergey Biryukov
2b539c3a91 Login and Registration: Set a better default value for $wp_error parameter in login_header().
To prevent someone from passing a string (which would not be added to a new `WP_Error` instance), check for `is_wp_error()` explicitly.

Props desrosj, chetan200891, spyderbytes, lbenicio, sebastien@thivinfo.com, abdullahramzan.
Fixes #44052.

git-svn-id: https://develop.svn.wordpress.org/trunk@43457 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 14:09:22 +00:00
Sergey Biryukov
dec7594a9b Privacy: Change @since entry for _wp_privacy_settings_filter_draft_page_titles() added in [43376] to 4.9.8.
See #44100.

git-svn-id: https://develop.svn.wordpress.org/trunk@43454 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 13:47:36 +00:00
Sergey Biryukov
83e8e6c003 Privacy: Change @since entry for user_request_confirmed_email_subject filter added in [43373] to 4.9.8.
See #44382.

git-svn-id: https://develop.svn.wordpress.org/trunk@43451 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 12:11:14 +00:00
Andrew Ozz
facf361e88 TinyMCE: update to 4.8.0, changelog: https://www.tiny.cloud/docs/changelog/#version480july112018
Fixes #44134.

git-svn-id: https://develop.svn.wordpress.org/trunk@43447 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-16 08:06:32 +00:00
Aaron Jorbin
f673d1851c Privacy: Silence is golden and invisible.
"Be more discrete." declared matt in [3155], and since then, "Silence is Golden" has been the calling card of placeholder index files. Historically, these have been php files, but [43012] changed that and added index.html files for privacy export generated folders.

The php silence files produce no visible content. This adds consistency with these new html files in that there will be no visible content. Silence will fall when the question is asked.

Fixes #44195.
Props audrasjb, rafsuntaskin, Ov3rfly, johnbillion, pento



git-svn-id: https://develop.svn.wordpress.org/trunk@43446 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-15 23:38:14 +00:00
Gary Pendergast
46c238ca78 REST API: Tweak permission checks for taxonomy and term endpoints
To match behaviour in the Classic Editor, we need to slightly loosen permissions on taxonomy and term endpoints. This allows users to create terms to assign to a post that they're editing.

Props danielbachhuber.
Fixes #44096.



git-svn-id: https://develop.svn.wordpress.org/trunk@43440 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 04:23:35 +00:00
Gary Pendergast
585c862faf REST API: Expose revision count and last revision ID on Post response
So that REST API clients can show appropriate UI for a post's revisions, it needs to know how many revisions the post has, and what the latest revision ID is.

Props kadamwhite, danielbachhuber, birgire, TimothyBlynJacobs.
Fixes #44321.



git-svn-id: https://develop.svn.wordpress.org/trunk@43439 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 04:06:23 +00:00
Gary Pendergast
81d2390d29 REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema".
There are a variety of operations a WordPress user can only perform if they have the correct capabilities. A REST API client should only display UI for one of these operations if the WordPress user can perform the operation.

Rather than requiring REST API clients to calculate whether to display UI based on potentially complicated combinations of user capabilities, `targetSchema` allows us to expose a single flag to show whether the corresponding UI should be displayed.

This change also includes flags on post objects for the following actions:

- `action-publish`: The current user can publish this post.
- `action-sticky`: The current user can make this post sticky, and the post type supports sticking.
- `action-assign-author': The current user can change the author on this post.
- `action-assign-{$taxonomy}`: The current user can assign terms from the "$taxonomy" taxonomy to this post.
- `action-create-{$taxonomy}`: The current user can create terms int the "$taxonomy" taxonomy.

Props TimothyBlynJacobs, danielbachhuber.
Fixes #44287.



git-svn-id: https://develop.svn.wordpress.org/trunk@43437 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-11 06:22:10 +00:00
Sergey Biryukov
7569772234 Plugins: Disable "Install Now" button for plugins that require a higher version of PHP or WordPress.
Display a notice with an explanation and the steps required to resolve the issue.

Props afragen, schlessera, flixos90, nerrad, melchoyce, boemedia, hedgefield, joyously, johnalarcon, lakenh, afercia, acirujano, ibantxillo, SergeyBiryukov.
Fixes #43986.

git-svn-id: https://develop.svn.wordpress.org/trunk@43436 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-09 13:44:53 +00:00
Felix Arntz
3d85e311ef Privacy: Fix a further inconsistency of site name and URL usage in notification emails.
This is a follow-up to [43388].

Props desrosj.
Fixes #44396.


git-svn-id: https://develop.svn.wordpress.org/trunk@43435 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-08 13:54:02 +00:00
John Blackbourn
f584b5755a Date/Time: Add support for the c and r shorthand formats in date_i18n().
Props Rarst, pbearne

Fixes #20973


git-svn-id: https://develop.svn.wordpress.org/trunk@43434 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 23:10:01 +00:00
John Blackbourn
adbec850ef Media: Update the @since tag for wp_normalize_path() as this has been backported to th 3.9 (and all other) branches.
See #42837


git-svn-id: https://develop.svn.wordpress.org/trunk@43406 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 15:20:46 +00:00
John Blackbourn
0f5488c3fc Media: Limit thumbnail file deletions to the same directory as the original file.
git-svn-id: https://develop.svn.wordpress.org/trunk@43392 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 14:31:24 +00:00
Anton Timmermans
ec9d77b103 Docs: Fix default values for customize/controls.js.
The old values cannot be parsed by JSDoc.

Props herregroen.
Fixes #44520.


git-svn-id: https://develop.svn.wordpress.org/trunk@43391 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-05 14:06:01 +00:00
Felix Arntz
21190f2eac Date/Time: Fix usage of $gmt parameter in date_i18n() and clarify its behavior.
The docs for `date_i18n()` and its filter now correctly state that the `$gmt` parameter is only taken into account if no timestamp is provided. Furthermore, a bug with that parameter is fixed, as it is now ensured that the timezone used with it is `UTC`.

Props Rarst.
Fixes #38771.


git-svn-id: https://develop.svn.wordpress.org/trunk@43389 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-04 23:42:59 +00:00
Felix Arntz
97cacadc50 Privacy: Use consistent values for the site name and URL used in notification emails.
The functions `send_confirmation_on_profile_email()`, `_wp_privacy_send_request_confirmation_notification()`, `_wp_privacy_send_erasure_fulfillment_notification()`, and `wp_send_user_request()` all include a title and URL indicating the current site. However, so far they have dealt with those values inconsistently, sometimes using the site values, other times using the network values if in a multisite. This changeset ensures that only the current site is taken into account in all cases and that special characters in the site name are consistently decoded.

Props subrataemfluence, desrosj.
Fixes #44396.


git-svn-id: https://develop.svn.wordpress.org/trunk@43388 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-03 16:59:36 +00:00
Felix Arntz
d448c448ca Date/Time: Add support for gmt_offset to date_i18n().
Prior to this change, `date_i18n()` only supported the `timezone_string` option, causing incorrect timezones to appear in formatted dates on sites that still rely on the `gmt_offset` option.

Props Rarst.
Fixes #34835.


git-svn-id: https://develop.svn.wordpress.org/trunk@43387 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-03 15:58:58 +00:00
Felix Arntz
d3a198df34 Taxonomy: Introduce is_taxonomy_viewable().
This utility function allows for easy detection whether terms for a taxonomy are considered publicly viewable.

Props andizer.
Fixes #44466.


git-svn-id: https://develop.svn.wordpress.org/trunk@43386 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-03 10:28:39 +00:00
Sergey Biryukov
8e96abbcc2 Docs: Add missing backtick in delete_metadata() DocBlock.
Props dilipbheda, cliffpaulick.
Fixes #44433.

git-svn-id: https://develop.svn.wordpress.org/trunk@43385 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-02 17:58:00 +00:00
Sergey Biryukov
0e7ed499e0 Date/Time: Simplify mysql_to_rfc3339().
Erasing timezone with a regular expression is redundant, the date could be just formatted in the respective format instead.

Props Rarst.
Fixes #42542.

git-svn-id: https://develop.svn.wordpress.org/trunk@43384 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 18:00:58 +00:00
Sergey Biryukov
63aab770eb Docs: Correct description for mysql_to_rfc3339().
Despite historical function name, the output does not conform to RFC3339 format, which must contain timezone.

Props Rarst.
See #42542.

git-svn-id: https://develop.svn.wordpress.org/trunk@43383 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 17:52:58 +00:00
Felix Arntz
0a9c044283 Multisite: Count users in a more performant way when listing sites in the network admin.
Props spacedmonkey.
Fixes #44368.


git-svn-id: https://develop.svn.wordpress.org/trunk@43382 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 16:29:33 +00:00
Felix Arntz
d399bcce30 Role/Capability: Rename upgrade_php capability to more suitable update_php.
This brings the name in line with user-facing language and similar names of existing related capabilities. Since the capability has not been part of any WordPress release, it can be renamed without any backward-compatibility implications.

Also missing props benhuberman for [43006].

Fixes #44457.


git-svn-id: https://develop.svn.wordpress.org/trunk@43381 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 15:04:26 +00:00
Sergey Biryukov
efe9a3eb21 Docs: Improve documentation for date_i18n()'s second argument.
Despite previously being labeled as a Unix timestamp, in reality it's a sum of Unix timestamp and timezone offset in seconds.

Props Rarst.
See #38771.

git-svn-id: https://develop.svn.wordpress.org/trunk@43380 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-26 13:18:13 +00:00
Andrew Ozz
6b366c6620 Privacy: use wp_login_url() for the link in the user confirmation email.
Props desrosj, usmankhalid.
Fixes #44353.

git-svn-id: https://develop.svn.wordpress.org/trunk@43379 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-25 15:01:29 +00:00
K. Adam White
a830dbcab3 REST API: Support meta registration for specific object subtypes.
Introduce an `object_subtype` argument to the args array for `register_meta()` which can be used to limit meta registration to a single subtype (e.g. a custom post type or taxonomy, vs all posts or taxonomies).

Introduce `register_post_meta()` and `register_term_meta()` wrapper methods for `register_meta` to provide a convenient interface for the common case of registering meta for a specific taxonomy or post type. These methods work the way plugin developers have often expected `register_meta` to function, and should be used in place of direct `register_meta` where possible.

Props flixos90, tharsheblows, spacedmonkey.
Fixes #38323.



git-svn-id: https://develop.svn.wordpress.org/trunk@43378 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-21 21:06:50 +00:00
Gary Pendergast
cdd9910f01 Emoji: Update Twemoji to version 11.0.
🦹

Props kraftbj,
Fixes #44339.



git-svn-id: https://develop.svn.wordpress.org/trunk@43377 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-20 04:20:32 +00:00
Andrew Ozz
1ebcb33c3c Privacy: append (Draft) to draft page titles in the page drop-down on the Privacy Settings screen.
Props allendav, desrosj.
Fixes #44100.

git-svn-id: https://develop.svn.wordpress.org/trunk@43376 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-19 12:11:46 +00:00