Commit Graph

40419 Commits

Author SHA1 Message Date
K. Adam White
b926baa51d REST API: Support dot.nested hierarchical properties in _fields query parameter.
Enable clients to opt-in to receipt of one or more specific sub-properties within a response, and not other sub-properties.
Skip potentially expensive filtering and processing for post resources which were explicitly not requested.

Props kadamwhite, TimothyBlynJacobs, dlh.
Fixes #42094.


git-svn-id: https://develop.svn.wordpress.org/trunk@46184 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 14:04:51 +00:00
Sergey Biryukov
5f1cbd7165 Bootstrap/Load: Reorganize the initialization flow so that the check for PHP and MySQL requirements could run as early as possible.
This allows us to use PHP 5.6+ syntax in more files, and display a proper error message on older PHP versions, instead of causing a parse error.

Fixes #48059.

git-svn-id: https://develop.svn.wordpress.org/trunk@46183 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 12:01:03 +00:00
Sergey Biryukov
a22920743b Tests: Replace join() with implode() in do_enclose() tests introduced in [46175], and ensure the arguments passed are in the correct order.
The `implode()` function accepts two parameters, `$glue` and `$pieces`. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of `$glue, $pieces` be used. It is also generally considered best practice to use the canonical function rather than an alias.

Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0.

Props jrf.
Fixes #36824. See #47746.

git-svn-id: https://develop.svn.wordpress.org/trunk@46182 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 11:45:15 +00:00
Sergey Biryukov
e5bee4ef68 Docs: Format multi-line comment in [46180] per the documentation standards.
See #45066.

git-svn-id: https://develop.svn.wordpress.org/trunk@46181 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 11:39:01 +00:00
Sergey Biryukov
a87122688b Tests: Update unit tests to account for the removal of old wp-a11y from the loaded scripts in [46179].
Props sstoqnov.
See #45066, #48071.

git-svn-id: https://develop.svn.wordpress.org/trunk@46180 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 11:14:38 +00:00
Andrea Fercia
aeac7fe2e7 Script Loader: Remove old wp-a11y from the loaded scripts after [46167] and [46169].
Props garrett-eclipse, sstoqnov.
See #45066.
Fixes #48071.


git-svn-id: https://develop.svn.wordpress.org/trunk@46179 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 09:54:00 +00:00
Boone Gorges
754056e218 Improve performance of trackback query in do_all_pings().
Previously, the direct SQL query used to identify trackbacks in
`do_all_pings()` performed poorly, due to an unindexed query against the
`to_ping` column. We improve performance in two ways. First, we switch
to using a postmeta flag for posts that require trackbacks to be sent;
queries joining against the postmeta table that check only the `meta_key`
are generally quite fast. Second, we switch to the use of `WP_Query`,
making the query cacheable and filterable using standard methods.

Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
Fixes #36824.

git-svn-id: https://develop.svn.wordpress.org/trunk@46178 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 02:05:25 +00:00
Boone Gorges
3419633de4 Use WP_Query when sending pingbacks.
Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
See #36824.

git-svn-id: https://develop.svn.wordpress.org/trunk@46177 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 01:59:06 +00:00
Boone Gorges
daa1da924d PHPCS: Fix coding standards violations in do_enclose().
* Use strict checking when appropriate in `in_array()` checks.
* Improved comment formatting.
* Yoda and strict equality checks where appropriate.

See #36824.

git-svn-id: https://develop.svn.wordpress.org/trunk@46176 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 01:53:03 +00:00
Boone Gorges
48e280db32 Improve do_enclose() logic on post publish.
Removing the direct SQL query in `do_all_pings()` improves filterability.

As part of this change, the signature of `do_enclose()` is changed so that
a null `$content` parameter can be passed, with the `$content` then inferred
from the `$post` passed in the second parameter. In addition, the second
parameter was modified so that a post ID or a `WP_Post` object can be
provided. These changes make it possible to trigger enclosure checks with
a post ID alone (as in `do_all_pings()`) and also brings the function
signature in line with `do_trackbacks()` and `pingback()`.

Props dshanske, spacedmonkey, janw.oostendorp, mrmadhat, birgire.
See #36824.

git-svn-id: https://develop.svn.wordpress.org/trunk@46175 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 01:48:54 +00:00
Andrew Ozz
20a17438d0 Uploads: add helper functions for setting, getting, and deleting the temp upload reference used to the attachment_id when retrying to make image sub-sizes.
See #47872.

git-svn-id: https://develop.svn.wordpress.org/trunk@46174 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 01:25:14 +00:00
Andrew Ozz
684f30fd7b TinyMCE: update to version 4.9.6. Changelog: https://github.com/tinymce/tinymce/blob/4.x/changelog.txt. Includes fix for the Permission denied to access property "nodeType" error.
Fixes #47437.

git-svn-id: https://develop.svn.wordpress.org/trunk@46173 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-19 00:59:59 +00:00
Jake Spurlock
3d40bbeef5 Add SMS to the list of allowed protocols.
This commit expands the list of allowed protocols. It adds the `sms://` which can be used to open meessaging clients for mobile users.

Props rilwis, kraftbj

Fixes #39415


git-svn-id: https://develop.svn.wordpress.org/trunk@46172 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 23:37:08 +00:00
Sergey Biryukov
150b301ac0 Script Loader: Move the current_theme_supports() check above the wp_default_(scripts|styles) action, for consistency.
See #42804.

git-svn-id: https://develop.svn.wordpress.org/trunk@46171 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 22:41:29 +00:00
Sergey Biryukov
88bf910518 Script Loader: Only check current theme's HTML5 support for scripts and styles on front end.
Avoids a fatal error in the admin if `SCRIPT_DEBUG` is disabled.

Props azaozz.
See #42804.

git-svn-id: https://develop.svn.wordpress.org/trunk@46170 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 22:33:45 +00:00
Jake Spurlock
b8533a19b8 Accesibility: Replace wp-a11y.js with @wordpress/a11y package
Continuation of [46167]. This fixes the tests that ended up broken following the previous commit.

We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also 
used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure 
webpack to load is an external.

Props, garrett-eclipse

Fixes #45066



git-svn-id: https://develop.svn.wordpress.org/trunk@46169 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 22:29:53 +00:00
Andrea Fercia
9d339b4d7b Media: remove leftover test string change after [45499].
Props imath, audrasjb.
Fixes #48067.


git-svn-id: https://develop.svn.wordpress.org/trunk@46168 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 19:32:32 +00:00
Jake Spurlock
8029e23ffe Accessibility: Replace wp-a11y.js with @wordpress/a11y package
We've extracted wp-includes/wp-a11y.js to a reusable package wordpress/a11y which is published on NPM. Let's make sure this package is also used in WordPress core. Once all the JavaScript is built using webpack, we can also import this package wherever it is used and configure webpack to load is an external.

Props omarreiss, herregroen, desrosj, ocean90, afercia, sstoqnov



git-svn-id: https://develop.svn.wordpress.org/trunk@46167 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 17:40:35 +00:00
Aaron Jorbin
b7df2ea08c External Library: Update getid3 to 1.9.18
Follow up to r46112 as getid3 has tagged an official release.

Changes: 00f3fbfd77...v1.9.18

Props desrosj, jkitchen.
Fixes #47751 #40883 #43836.


git-svn-id: https://develop.svn.wordpress.org/trunk@46166 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 14:53:01 +00:00
SergeyBiryukov
baaaef5b63 Bundled Themes: Declare HTML5 support for scripts and styles.
Fixes #42804.

git-svn-id: https://develop.svn.wordpress.org/trunk@46165 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 14:50:02 +00:00
Sergey Biryukov
5fdf48c0ec Script Loader: Introduce HTML5 support for scripts and styles.
When a theme declares HTML5 support for script and styles via `add_theme_support( 'html5', array( 'script', 'style' ) )`, the `type="text/javascript"` and `type="text/css"` attributes are omitted.

These attributes are unnecessary in HTML5 and cause warnings in the W3C Markup Validation Service.

Props sasiddiqui, swissspidy, knutsp, SergeyBiryukov.
See #42804.

git-svn-id: https://develop.svn.wordpress.org/trunk@46164 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 14:49:30 +00:00
Andrea Fercia
0dbd752500 Accessibility: Add aria-current to the Archives, Categories, and Recent Posts widgets output.
The `aria-current` attribute is a simple, effective, way to help assistive technology users orientate themselves within a list of items.

Continues the introduction in core of the `aria-current` attribute after [41359] and following changes.

Props audrasjb, melchoyce.
Fixes #47094.


git-svn-id: https://develop.svn.wordpress.org/trunk@46163 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-18 12:24:35 +00:00
John Blackbourn
4b3eb36a5b Docs: Improve docs for upload and wp_die() related functions.
See #47110 


git-svn-id: https://develop.svn.wordpress.org/trunk@46162 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 21:02:22 +00:00
Jonathan Desrosiers
45f1fbbceb Docs: Add missing descriptions for functions in wp-admin/update-core.php.
Also, fix the `@since` annotation added in [45480] to include the correct version.

Props SergeyBiryukov, ajayghaghretiya1.
Fixes #47424.

git-svn-id: https://develop.svn.wordpress.org/trunk@46161 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 20:42:57 +00:00
Jonathan Desrosiers
65ec280a54 Posts, Post Types: Allow support arguments to be specified when registering post types.
The `add_post_type_support()` function accepts an optional third parameter that allows extra arguments to be supplied to configure post type support for a given feature. However, because of how `register_post_type()` and `WP_Post_Type->add_supports()` work, it is currently impossible to pass these additional arguments when initially registering a post type with `register_post_type()`.

This change makes it possible to supply additional arguments for a feature using the `supports` argument of `register_post_type()`.

Props MaximeCulea, seuser, desrosj, johnbillion.
Fixes #40413.

git-svn-id: https://develop.svn.wordpress.org/trunk@46160 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 19:57:18 +00:00
Jonathan Desrosiers
5e38f8219b Build/Test Tools: Improve test coverage for wp_validate_boolean().
This change also reworks the test class to use a data provider.

Props pbearne, desrosj
Fixes #39868

git-svn-id: https://develop.svn.wordpress.org/trunk@46159 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 18:48:27 +00:00
Adam Silverstein
5a200bdb7a Build/Test Tools: fix source map loading in Firefox.
Fix an issue that prevented source maps from loading correctly in Firefox developer tools. Matches a fix introduced in Gutenberg build in PR:17024.

Props pierlo, andraganescu.
Fixes #47870.



git-svn-id: https://develop.svn.wordpress.org/trunk@46158 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 17:26:38 +00:00
Adam Silverstein
823b0d2c64 External Libraries: Update Backbone.js to 1.4.0.
Upgrade Backbone to the latest stable version. Fix some issues in Media with `listenTo` which changed in this version, see https://backbonejs.org/#changelog.

Props desrosj, priyankkpatel, pierlo.
Fixes #47478.



git-svn-id: https://develop.svn.wordpress.org/trunk@46157 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 17:18:32 +00:00
Sergey Biryukov
ed25bc3080 Docs: Correct accepted values for search_columns parameter in WP_User_Query.
Props meloniq.
Fixes #48057.

git-svn-id: https://develop.svn.wordpress.org/trunk@46156 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 15:42:51 +00:00
Jonathan Desrosiers
352665d6df General: Ensure the arguments passed to implode() are in the correct order.
The `implode()` function accepts two. parameters, `$glue` and `$pieces`. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of `$glue, $pieces` be used.

Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0.

This change fixes the occurrences of reversed arguments in Core with the exception of those contained in included external libraries. These will be handled separately.

Props jrf, jorbin.
See #47746.

git-svn-id: https://develop.svn.wordpress.org/trunk@46155 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 13:39:15 +00:00
Sergey Biryukov
5928234d05 Date/Time: Introduce get_post_datetime() to retrieve post published or modified time as a DateTimeImmutable object instance.
Introduce `get_post_timestamp()` to retrieve post published or modified time as a Unix timestamp.

Use `get_post_datetime()` in `get_post_time()` and `get_post_modified_time()` to return correct GMT time if default timezone is changed from UTC.

Props Rarst, johnregan3.
Fixes #25002.

git-svn-id: https://develop.svn.wordpress.org/trunk@46154 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-17 11:13:25 +00:00
John James Jacoby
7cbb1f32a3 Network Admin: Allow Sites to have filterable States in List Table rows.
This change introduces a new `site_states()` method to the Sites List Table class (with a new `display_site_states` filter inside of it) following the pattern popularized in other List Table classes before it (Posts, Media, etc...)

Fixes #37684. Props mnelson4, pbiron, jeremyfelt, johnjamesjacoby.

git-svn-id: https://develop.svn.wordpress.org/trunk@46153 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 23:33:45 +00:00
Sergey Biryukov
9218e2cc50 Docs: Improve documentation for get_bookmarks().
Props pbiron.
Fixes #48053.

git-svn-id: https://develop.svn.wordpress.org/trunk@46152 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 19:54:15 +00:00
Sergey Biryukov
444834f5a0 Site Health: Add a link to "Debugging in WordPress" support article to fatal PHP error handler's default message.
Props garrett-eclipse, tobifjellner, dkarfa, hareesh-pillai.
Fixes #47681.

git-svn-id: https://develop.svn.wordpress.org/trunk@46151 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 17:22:32 +00:00
Sergey Biryukov
fd31d7f872 Docs: Improve @return value description for wp_xmlrpc_server::minimum_args().
See #47110.

git-svn-id: https://develop.svn.wordpress.org/trunk@46150 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 16:31:13 +00:00
Sergey Biryukov
31fa37f06d Code Modernisation: Remove redundant PHP 4 code from do_action().
As of PHP 5, objects are always passed by reference, so this has not been needed for quite some time.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46149 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 14:47:53 +00:00
Sergey Biryukov
ea350997e6 XML-RPC: Avoid a PHP warning in wp_xmlrpc_server::minimum_args() if $args is not an array.
Correct the documentation to clarify that array is the only acceptable type for `$args`.

Props bitcomplex, dkarfa.
Fixes #48046.

git-svn-id: https://develop.svn.wordpress.org/trunk@46148 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 09:57:30 +00:00
Sergey Biryukov
f360f879f8 Widgets: Introduce register_sidebar_defaults filter for default arguments in register_sidebar().
Props patilvikasj, powerbuoy.
Fixes #48033.

git-svn-id: https://develop.svn.wordpress.org/trunk@46147 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-16 09:13:01 +00:00
Sergey Biryukov
209666d332 Code Modernisation: Simplify some logic in apply_filters().
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46146 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 12:03:04 +00:00
Sergey Biryukov
802c23e059 Code Modernisation: Replace call_user_func_array() in tests/phpunit/tests/db.php with dynamic function calls.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46145 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:55:42 +00:00
Sergey Biryukov
1ace25088f Code Modernisation: Replace call_user_func_array() in various __call() methods with dynamic function calls.
The callback in these functions is always checked against a limited list of valid callbacks that can be safely changed to dynamic function calls.

Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46144 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:53:01 +00:00
Sergey Biryukov
1418bd0ffa Code Modernisation: Replace call_user_func_array() in wp-includes/class-wp-walker.php with dynamic function calls.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46143 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:49:51 +00:00
Sergey Biryukov
927098e5aa Code Modernisation: Replace call_user_func_array() in wp-cron.php with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46142 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:47:38 +00:00
Sergey Biryukov
0432a9f6b5 Code Modernisation: Remove redundant call to func_get_arg() in wp-includes/class-wp-rewrite.php.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46141 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:46:44 +00:00
Sergey Biryukov
0521e61398 Code Modernisation: Remove redundant calls to func_get_arg() in wp-includes/class-wp-admin-bar.php.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46140 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:45:45 +00:00
Sergey Biryukov
d4d853ee3f Code Modernisation: Replace call_user_func_array() in combination with an empty array in wp-includes/class-wp-hook.php with call_user_func().
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46139 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:44:09 +00:00
Sergey Biryukov
fd05ea0de9 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/widgets.php and associated unit tests with a direct function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46138 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:40:08 +00:00
Sergey Biryukov
751f69be42 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46137 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:34:23 +00:00
Sergey Biryukov
f16a56ca41 Code Modernisation: Replace call_user_func_array() in wp-admin/includes/ajax-actions.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46136 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:33:20 +00:00
SergeyBiryukov
e17d5accc3 Code Modernisation: Replace call_user_func_array() in wp-includes/post-template.php with a dynamic function call.
Props jrf.
See #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@46135 602fd350-edb4-49c9-b593-d223f7449a82
2019-09-15 11:31:02 +00:00