Commit Graph

17584 Commits

Author SHA1 Message Date
Timothy Jacobs
d803f6bf82 REST API: Refactor WP_REST_Server::dispatch() to make internal logic reusable.
#50244 aims to introduce batch processing in the REST API. An important feature is the ability to enforce that all requests have valid data before executing the route callbacks in "pre-validate" mode.

This necessitates splitting `WP_REST_Server::dispatch()` into two methods so the batch controller can determine the request handler to perform pre-validation and then respond to the requests.

The two new methods, `match_request_to_handler` and `respond_to_request`, have a public visibility, but are marked as `@access private`. This is to allow for iteration on the batch controller to happen in the Gutenberg repository. Developers should not rely upon these methods, their visibility may change in the future.

See #50244.
Props andraganescu, zieladam, TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@48947 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-05 21:50:31 +00:00
Sergey Biryukov
1c1a7b8365 Media: In wp_ajax_image_editor(), check if the error property exists before accessing it.
This avoids a PHP notice when editing an image.

Follow-up to [48375].

Props Mista-Flo.
Fixes #51251.

git-svn-id: https://develop.svn.wordpress.org/trunk@48946 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-05 18:10:47 +00:00
Timothy Jacobs
88ec90d6df REST API: Support a route-level validation callback.
Most request data is validated on a per-parameter basis. Often, however, additional validation is needed that operates on the entire request object. Currently, this is done in the route callback and often in the `prepare_item_for_database` method specifically.

#50244 aims to introduce batch processing in the REST API. An important feature is the ability to enforce that all requests have valid data before executing the route callbacks in "pre-validate" mode.

This patch introduces support for calling a `validate_callback` after all parameter validation has succeeded. That allows moving more validation outside of the route callback and into `WP_REST_Request` which will improve "pre-validate" support.

Props TimothyBlynJacobs, zieladam.
Fixes #51255.
See #50244.




git-svn-id: https://develop.svn.wordpress.org/trunk@48945 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-05 18:07:46 +00:00
Sergey Biryukov
677af117a9 Comments: Rename WP_Comments_List_Table::comment_status_dropdown() to ::comment_type_dropdown().
This better reflects the purpose of the method, which doesn't have anything to do with a comment status.

Follow-up to [48521].

Props davidbaumwald, johnbillion, SergeyBiryukov.
Fixes #51248.

git-svn-id: https://develop.svn.wordpress.org/trunk@48943 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-05 00:31:03 +00:00
Sergey Biryukov
267e754b83 Docs: Further correct placement for wp_editor_expand filter DocBlock.
This ensures that the filter is only applied if the conditions before it are evaluated to true.

Follow-up to [48714].

Props johnbillion.
See #50768.

git-svn-id: https://develop.svn.wordpress.org/trunk@48942 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-04 21:46:11 +00:00
John Blackbourn
d34a21c950 Docs: Various docblock corrections and improvements.
See #50768

git-svn-id: https://develop.svn.wordpress.org/trunk@48941 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-04 20:39:47 +00:00
Sergey Biryukov
5e2a75ef29 Administration: Give the $error variable in wp-admin/admin-header.php a more descriptive name.
This avoids a conflict with the same global variable used elsewhere, e.g. in Theme Editor.

Follow-up to [48850].

Props vinayak.anivase.
Fixes #51219.

git-svn-id: https://develop.svn.wordpress.org/trunk@48938 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-03 01:41:47 +00:00
Sergey Biryukov
5f4a8f75b5 Docs: Synchronize the description of the $format parameter in various date/time functions for posts and comments.
See #50768.

git-svn-id: https://develop.svn.wordpress.org/trunk@48929 602fd350-edb4-49c9-b593-d223f7449a82
2020-09-01 00:41:19 +00:00
Sergey Biryukov
23528d419a Script Loader: Add backward compatibility for JavaScript i18n globals and properties deprecated in WordPress 5.5.
The recommended approach for any plugins using these globals or properties is to switch to the newer `wp.i18n` functions.

In the meantime, this ensures that accessing any of these globals does not break the rest of the code on the page, and an appropriate warning message is logged to the JavaScript console.

Follow-up to: https://core.trac.wordpress.org/query?summary=~wp.i18n&milestone=5.5

Props omarreiss, peterwilsoncc, kbjohnson90, johnbillion, TimothyBlynJacobs, joostdevalk, ocean90, desrosj, SergeyBiryukov.
Fixes #51123.

git-svn-id: https://develop.svn.wordpress.org/trunk@48923 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-31 20:28:41 +00:00
Sergey Biryukov
d33fa375f6 Date/Time: In get_the_date() and related functions, pass the original, unmodified $format value to the filters.
Additionally, simplify the `$format` argument checks for consistency with similar checks in `get_the_modified_date()` and `get_the_modified_time()`.

Follow-up to [48912].

Props Rarst.
See #51184.

git-svn-id: https://develop.svn.wordpress.org/trunk@48918 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-31 18:28:42 +00:00
Sergey Biryukov
390f84b715 Themes: Normalize the installed theme path in Theme_Installer_Skin::do_overwrite() before comparing with the uploaded theme.
This ensures that the data for the currently installed theme is picked up properly when uploading a theme update on Windows.

Follow-up to [48390].

Props bobbingwide, wpamitkumar, mukesh27.
Fixes #51182.

git-svn-id: https://develop.svn.wordpress.org/trunk@48913 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-31 17:09:35 +00:00
Sergey Biryukov
3309309f6b Date/Time: Make sure get_the_date() and related functions return correct time if the format was specified as false.
Technically, the `$format` argument should always be a string, but passing `false` used to work before [47808], so this restores backward compatibility.

The list of affected functions:
* `get_the_date()`
* `get_the_time()`
* `get_comment_date()`
* `get_comment_time()`

Props wittich, Rarst, akabarikalpesh, SergeyBiryukov.
Fixes #51184.

git-svn-id: https://develop.svn.wordpress.org/trunk@48912 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-31 15:56:41 +00:00
Sergey Biryukov
c2aaa14d57 Docs: Add a @since note to the display_post_states filter to clarify that it is now also applied in the Customizer context.
If any admin functions are used within the filter, their existence should be checked with `function_exists()` before being used.

Follow-up to [47763], [48620].

Props audrasjb, garrett-eclipse, Howdy_McGee, dlh, khag7, SergeyBiryukov.
Fixes #51081.

git-svn-id: https://develop.svn.wordpress.org/trunk@48910 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-31 13:30:20 +00:00
Sergey Biryukov
812f49ae05 Docs: Clarify the usage of null for auto_update_{$type} filter.
The value is internally used to detect whether nothing has hooked into this filter.

Props audrasjb, pbiron, johnbillion, SergeyBiryukov.
Fixes #50848.

git-svn-id: https://develop.svn.wordpress.org/trunk@48909 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-31 13:18:39 +00:00
Sergey Biryukov
5ec12d64d6 Administration: Correct the padding for "Warning: these pages should not be the same" messages on Reading Settings screen.
Replace the legacy `.error` class with a more appropriate `.notice-warning`.

Props musicaljoeker, shital-patel, man4toman, garrett-eclipse, SergeyBiryukov.
Fixes #50766.

git-svn-id: https://develop.svn.wordpress.org/trunk@48906 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-29 00:41:00 +00:00
Sergey Biryukov
0013f5979c Media: Make the is_gd_image() function available on front end.
This avoids a fatal error if a plugin calls image creation or editing functions like `wp_imagecreatetruecolor()` outside of the admin.

Follow-up to [48798]

Props BackuPs.
Fixes #51174. See #50833.

git-svn-id: https://develop.svn.wordpress.org/trunk@48905 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-28 16:43:31 +00:00
Sergey Biryukov
673fcd7927 Comments: Check if reply heading text node exists before accessing its property in comment-reply.js.
Follow-up to [47506], [48876].

Props johannadevos, mailnew2ster.
Fixes #38009.

git-svn-id: https://develop.svn.wordpress.org/trunk@48904 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-28 13:10:29 +00:00
Sergey Biryukov
2afabce1c1 Docs: Correct formatting of the auto_theme_update_send_email filter DocBlock.
Synchronize description of the `$enabled` parameter with the `auto_plugin_update_send_email` filter.

Follow-up to [48889].

See #50768, #50988.

git-svn-id: https://develop.svn.wordpress.org/trunk@48903 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-28 02:36:39 +00:00
Sergey Biryukov
bb40a2698a Upgrade/Install: Only display the auto-update links on the Network Admin > Themes screen for themes that support the feature.
Follow-up to [48669], [48688].

Props afragen, pbiron, audrasjb, desrosj, SergeyBiryukov.
Fixes #51129.

git-svn-id: https://develop.svn.wordpress.org/trunk@48899 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 22:22:23 +00:00
Sergey Biryukov
a0b40ebd6a Script Loader: Disable concatenation for scripts with translations to ensure they are printed in the right order.
Props herregroen, ocean90, desrosj, mikeyarce, bobbingwide, audrasjb, johnbillion.
Fixes #50999.

git-svn-id: https://develop.svn.wordpress.org/trunk@48897 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 21:57:01 +00:00
Sergey Biryukov
6c395a5f3e Bootstrap/Load: Check if the __() function is available in wp_get_environment_type().
The function would not exist in `SHORTINIT` mode.

Follow-up to [48894].

See #50992.

git-svn-id: https://develop.svn.wordpress.org/trunk@48895 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 21:37:33 +00:00
Sergey Biryukov
a0864835a5 Bootstrap/Load: Remove the ability to alter the list of environment types in wp_get_environment_type().
The intention of `wp_get_environment_type()` is to provide a consistent means of identifying the environment type, not of identifying a specific environment.

Actual environments should fit within one of the existing types: `local`, `development`, `staging`, or `production`. That should cover the types that plugins and themes might be concerned about when toggling functionality. 

Props johnbillion, joostdevalk, TimothyBlynJacobs, jeremyfelt, batmoo, claytoncollie, Clorith, markjaquith, garrett-eclipse, GaryJ, elrae.
Fixes #50992.

git-svn-id: https://develop.svn.wordpress.org/trunk@48894 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 21:30:33 +00:00
Sergey Biryukov
6a6241ac6a Script Loader: Change the jquery handle back to an alias for jquery-core.
This ensures that `wp_localize_script( 'jquery', ... )` continues to work as expected, since `WP_Scripts::localize()` rewrites the `jquery` handle to `jquery-core` internally.

Follow-up to [48323].

Props mukesh27, rajeshsingh520, johnbillion, TimothyBlynJacobs, TobiasBg.
Fixes #50919.

git-svn-id: https://develop.svn.wordpress.org/trunk@48890 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 20:31:23 +00:00
Jonathan Desrosiers
c14417c5c9 Upgrade/Install: Pass details about the specific plugin and theme updates attempted to filters.
This adds an additional parameter to the `auto_plugin_update_send_email` and `auto_theme_update_send_email` filters to provide the additional context of which updates were attempted and their outcome. This will help plugin and theme auto-update emails to be better tailored to a site owner’s liking.

Props audrasjb, Paddy Landau, desrosj.
Fixes #50988.

git-svn-id: https://develop.svn.wordpress.org/trunk@48888 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 19:25:38 +00:00
Jorge Costa
fb04a13f46 Editor: update packages.
The following package versions were changed:
@wordpress/block-directory: 1.13.6 -> 1.13.7
@wordpress/block-editor: 4.3.6 -> 4.3.7
@wordpress/block-library: 2.22.6 -> 2.22.7
@wordpress/components: 10.0.5 -> 10.0.6
@wordpress/edit-post: 3.21.6 -> 3.21.7
@wordpress/editor: 9.20.6 -> 9.20.7
@wordpress/format-library: 1.22.6 -> 1.22.7
@wordpress/list-reusable-blocks: 1.21.5 -> 1.21.6
@wordpress/nux: 3.20.5 -> 3.20.6
@wordpress/server-side-render: 1.16.5 -> 1.16.6
Includes PR WordPress/gutenberg#24828

Props nosolosw, desrosj, SergeyBiryukov, youknowriad.
Fixes: #51151.

git-svn-id: https://develop.svn.wordpress.org/trunk@48884 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 16:34:37 +00:00
Timothy Jacobs
6c76a13139 REST API: Fix multi-type schemas with integer fields.
In [48306] support for multi-typed schemas was improved to first detect the data type of the value before applying further validation. The `integer` data type was detected using the new `rest_is_integer` function. This function used logic, however, that assumed that the value had already passed an `is_numeric` check. This meant that if `integer` and `string` were both acceptable types, the value would always be considered an `integer` causing the later accurate type validation to fail.

This commit fixes the `rest_is_integer` logic to include an `is_numeric` check.

Props rtagliento.
Fixes #51146.


git-svn-id: https://develop.svn.wordpress.org/trunk@48881 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 02:55:39 +00:00
Sergey Biryukov
c8b5610b91 Taxonomy: Make sure wp_terms_checklist() and Walker_Category_Checklist::start_el() properly handle an array of strings as selected_cats or popular_cats values.
Even with these values documented as an array of integers, they can technically also accept an array of strings, e.g. as form results.

Add a unit test.

Props brianhogg, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51137.

git-svn-id: https://develop.svn.wordpress.org/trunk@48880 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 02:46:22 +00:00
Sergey Biryukov
3066546426 Comments: Correct the check for reply element existence in comment-reply.js.
`document.getElementById()` returns `null` if no matching element was found, so the previous comparison didn't work as expected.

Follow-up to [47506].

Props mailnew2ster, sarahricker.
Fixes #38009.

git-svn-id: https://develop.svn.wordpress.org/trunk@48876 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 01:56:39 +00:00
Peter Wilson
bae635f1a0 Sitemaps: Prevent incorrect redirection of paged sitemap requests.
Update `redirect_canonical()` to account for custom pagination and URL format used by sitemaps in order to follow standard practices.

Introduce the function `get_sitemap_url()` to simplify getting the index and provider URLs as needed.

Props jonathanstegall, pbiron, GamerZ, salvoaranzulla, peterwilsoncc.
Fixes #50910.



git-svn-id: https://develop.svn.wordpress.org/trunk@48872 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 01:28:24 +00:00
Jonathan Desrosiers
066882a4a8 Media: Disable lazy-loading for custom logos by default.
Custom site logos are most commonly displayed above the fold, so lazy-loading is unnecessary.

Props demetris, khag7, johnbillion, rebasaurus, audrasjb.
Fixes #50933.

git-svn-id: https://develop.svn.wordpress.org/trunk@48870 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-27 01:06:01 +00:00
Sergey Biryukov
c7f5af72dc Upgrade/Install: Make the check for empty home option in __get_option() more resilient.
This addresses a regression in [47808], where the `home` check expected an empty string to use `siteurl` as a fallback, but `wpdb::get_var()` returns `null` if the option is empty.

Props fjarrett.
Fixes #51011.

git-svn-id: https://develop.svn.wordpress.org/trunk@48868 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-26 16:55:36 +00:00
Sergey Biryukov
2a9c68872e Quick/Bulk Edit: Revert [48134] to address the bottom "Bulk actions" dropdown not functioning properly on Posts and Users list tables.
A better solution for the original issue will be explored in a future release.

Props audrasjb, garrett-eclipse, webzunft, Krstarica, chunkysteveo, SergeyBiryukov.
Fixes #50882, #50998. See #46872.

git-svn-id: https://develop.svn.wordpress.org/trunk@48866 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-26 14:16:12 +00:00
Sergey Biryukov
efc5c63254 Editor: Remove some hardcoded text color values from patterns that have body text with no specific background color.
This ensures that the patterns respect the theme's default color for body text and avoids contrast issues, particularly in dark themes.

Props nrqsnchz, mapk, fullofcaffeine.
Fixes #50892.

git-svn-id: https://develop.svn.wordpress.org/trunk@48864 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-26 13:32:05 +00:00
Sergey Biryukov
cae856c8eb Administration: Remove non-color related styling from Modern color scheme.
Color schemes should only affect colors, to avoid diverging from a consistent and predictable layout, especially if core CSS rules subsequently change.

Follow-up to [48277], [48286], [48345].

Props Joen, johnbillion, afercia, johnjamesjacoby.
Fixes #51127. See #50504.

git-svn-id: https://develop.svn.wordpress.org/trunk@48862 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-26 13:17:36 +00:00
Sergey Biryukov
ad9f02ed80 Twenty Twenty: Add context to adjectives and homonyms.
This allows for better localization in languages where adjectives are translated differently depending on which noun they modify, or when a different translation is required for a noun vs. a verb.

Props dimadin, justinahinon.
Fixes #49797.

git-svn-id: https://develop.svn.wordpress.org/trunk@48861 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-26 01:33:45 +00:00
Sergey Biryukov
04d555e91d Editor: Make some hardcoded strings in block patterns translatable.
Follow-up to [48726].

Props justinahinon, audrasjb, nabilmoqbel, tobifjellner, yoavf, ramiy.
Fixes #50845.

git-svn-id: https://develop.svn.wordpress.org/trunk@48859 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-25 12:38:21 +00:00
Sergey Biryukov
25c9718a1e Bootstrap/Load: Add local environment type to wp_get_environment_type().
This gives developers a better control over their existing development workflow and ensures that `local` is not the exact same as `development` if it does not need to be.

Props claytoncollie, johnbillion, jeremyfelt, kreppar, dushakov, TimothyBlynJacobs, Ipstenu, khag7, knutsp, Clorith, markjaquith, joostdevalk, SergeyBiryukov.
Fixes #51064.

git-svn-id: https://develop.svn.wordpress.org/trunk@48856 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-24 22:30:36 +00:00
Sergey Biryukov
8e7e3c5b72 Docs: Improve documentation for wp_lazy_loading_enabled() per the documentation standards.
See #50768.

git-svn-id: https://develop.svn.wordpress.org/trunk@48855 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-24 22:14:17 +00:00
Sergey Biryukov
4869de2a1c Docs: Add a @since note about the $srcset and $sizes attributes added to wp_get_attachment_image().
Follow-up to [34855].

See #51122.

git-svn-id: https://develop.svn.wordpress.org/trunk@48853 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-24 22:10:25 +00:00
Sergey Biryukov
62260b9fbf Docs: Add documentation and a @since note about the loading attribute added to wp_get_attachment_image().
Follow-up to [48272].

Props audrasjb.
Fixes #51122.

git-svn-id: https://develop.svn.wordpress.org/trunk@48852 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-24 22:02:44 +00:00
Sergey Biryukov
ce10049fcc Administration: Don't print the .php-error class in the admin header for PHP notices in wp-config.php.
Any notices in that file happen before `WP_DEBUG` takes effect,	and should not be displayed with the `error_reporting` level previously set in `wp-load.php`.

Adding the class when there is no notice displayed results in extra padding under the admin bar, which should be avoided.

Follow-up to [20102], [21025], [26620], [47745].

Props akissz, tw2113, laxman-prajapati, sabernhardt, johnbillion, SergeyBiryukov.
Fixes #51073.

git-svn-id: https://develop.svn.wordpress.org/trunk@48850 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-24 10:46:30 +00:00
Sergey Biryukov
380145e073 Docs: Update the description for the $legacy parameter of wp_count_terms() for consistency with get_terms().
Follow-up to [48840].

See #36399.

git-svn-id: https://develop.svn.wordpress.org/trunk@48843 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-23 00:06:04 +00:00
Sergey Biryukov
153d07b93a REST API: In WP_REST_Block_Directory_Controller::get_items(), make sure the blocks data for a plugin is not empty before proceeding.
This avoids a PHP notice if the API returns a plugin with empty data for `blocks` key.

Props khag7, TwentyZeroTwo, justinahinon, TimothyBlynJacobs, dd32, SergeyBiryukov.
Fixes #51018.

git-svn-id: https://develop.svn.wordpress.org/trunk@48842 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-22 01:52:42 +00:00
Sergey Biryukov
2e2ef9e538 Editor: Use wp_add_inline_script() instead of wp_localize_script() to pass the _wpMetaBoxUrl value to the wp-editor script.
This fixes a PHP 8 "Only the first byte will be assigned to the string offset" warning on Edit Post screen.

The correct usage of `wp_localize_script()` is to pass an array of data, not a string.

Fixes #51108.

git-svn-id: https://develop.svn.wordpress.org/trunk@48841 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-22 00:03:01 +00:00
Felix Arntz
0228dd6a5d Taxonomy: Allow for wp_count_terms( $args ) signature, making passing a taxonomy optional.
This brings `wp_count_terms()` in line with other taxonomy functions such as `get_terms()` which technically no longer require a taxonomy. Similar to the previously modified functions, no deprecation warning is triggered when using the legacy signature.

Fixes #36399.


git-svn-id: https://develop.svn.wordpress.org/trunk@48840 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-21 22:30:06 +00:00
Sergey Biryukov
3b1d1bfa7a Code Modernization: Fix PHP 8 "ArgumentCountError: array_merge() does not accept unknown named parameters" fatal error in retrieve_widgets().
As per the documentation of `call_user_func_array()`, the `$param_arr` should be a (numerically) indexed array, not a string-keyed array.

As we can use the spread operator in PHP 5.6+, there isn't really any need to use `call_user_func_array()` anyhow, we can call the `array_merge()` function directly.

The caveat to this is that the spread operator only works on numerically indexed arrays, so we need to wrap the `$sidebars_widgets` variable in a call to `array_values()` when using the spread operator.

Using `array_values()` in the existing `call_user_func_array()` call would also have solved this, but the solution now proposed, has the added benefit of getting rid of the overhead of `call_user_func_array()`.

Props jrf.
See #50913.

git-svn-id: https://develop.svn.wordpress.org/trunk@48839 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-21 21:49:02 +00:00
Sergey Biryukov
29bfc56ca2 Code Modernization: Fix PHP 8 "argument must be passed by reference, value given" error in WP_Comment_Query::get_comments().
The WP native `get_comment()` function expects the first argument `$comment` to be passed by reference.

The PHP `array_map()` function, however, passes by value, not by reference, resulting in an "arguments must be passed by reference, value given" error.

The PHP native `array_walk()` function does pass by reference. Using this prevents the error on PHP 8 and maintains the existing behaviour on PHP < 8.

Props jrf.
See #50913.

git-svn-id: https://develop.svn.wordpress.org/trunk@48838 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-21 21:32:49 +00:00
Sergey Biryukov
387bbeb286 Twenty Nineteen: Remove trailing commas after selectors in style-editor.scss.
Remove one empty CSS block.

Props justinahinon.
Fixes #51095.

git-svn-id: https://develop.svn.wordpress.org/trunk@48837 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-21 15:40:56 +00:00
Sergey Biryukov
493a88c666 Privacy: Avoid a PHP 7.4 notice in WP_Privacy_Policy_Content::text_change_check().
When iterating over the items stored in '_wp_suggested_privacy_policy_content` meta value for the Privacy Policy page, make sure the item is an array before accessing its properties.

Props treibstoff.
Fixes #51084.

git-svn-id: https://develop.svn.wordpress.org/trunk@48836 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-21 01:11:19 +00:00
Sergey Biryukov
e87d86b2ae Docs: Correct references to WP_Filesystem_Base methods in various DocBlocks.
Props pbiron.
Fixes #51087.

git-svn-id: https://develop.svn.wordpress.org/trunk@48835 602fd350-edb4-49c9-b593-d223f7449a82
2020-08-21 00:41:43 +00:00