Sergey Biryukov
2670a6ad14
Docs: Synchronize descriptions of some query functions and their counterpart methods in WP
and WP_Query
classes:
...
* `set_query_var()`
* `get_query_var()`
* `get_queried_object()`
* `get_queried_object_id()`
Switch to third-person singular verbs, per the documentation standards.
See #50768 , #42783 .
Built from https://develop.svn.wordpress.org/trunk@49095
git-svn-id: http://core.svn.wordpress.org/trunk@48857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-06 08:59:04 +00:00
noisysocks
088aa1e864
Docs: Improve set_query_var() inline docs.
...
Makes the inline docs for set_query_var() consistent with the inline docs for
get_query_var().
See #42783 .
Props stevenlinx, markparnell.
Built from https://develop.svn.wordpress.org/trunk@49094
git-svn-id: http://core.svn.wordpress.org/trunk@48856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-06 05:40:11 +00:00
noisysocks
274cb9718d
Editor: Rename _should_load_block_editor_scripts_and_styles to wp_should_load_block_editor_scripts_and_styles
...
Follow-up to [49080].
Props zieladam, frank-klein.
See #51330 .
Built from https://develop.svn.wordpress.org/trunk@49093
git-svn-id: http://core.svn.wordpress.org/trunk@48855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-06 04:18:10 +00:00
Sergey Biryukov
dc7bda9620
Docs: Add brackets to function names in some @see
tags, for consistency.
...
Props ravipatel, davidbaumwald.
Fixes #51441 .
Built from https://develop.svn.wordpress.org/trunk@49092
git-svn-id: http://core.svn.wordpress.org/trunk@48854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-05 14:03:02 +00:00
Sergey Biryukov
bea55db921
Docs: Add missing @return
tag to Language_Pack_Upgrader::check_package()
.
...
Synchronize documentation of the `::check_package()` method between `Plugin_Upgrader`, `Theme_Upgrader`, and `Language_Pack_Upgrader`.
Props ankitmaru, mukesh27, desrosj.
Fixes #51448 .
Built from https://develop.svn.wordpress.org/trunk@49091
git-svn-id: http://core.svn.wordpress.org/trunk@48853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-05 13:44:11 +00:00
Sergey Biryukov
1651342d2b
Privacy: Improve clarity of privacy error strings.
...
Primarily this adds "user privacy" to the strings for privacy requests, so they are more easily distinguished from other system actions within logs.
Props garrett-eclipse, carike, birgire.
Fixes #51351 .
Built from https://develop.svn.wordpress.org/trunk@49090
git-svn-id: http://core.svn.wordpress.org/trunk@48852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-04 03:23:09 +00:00
Sergey Biryukov
0f13b2c268
Docs: Add @since
notes for the $id
parameter of REST API search controller accepting a string.
...
Follow-up to [49088].
See #51131 .
Built from https://develop.svn.wordpress.org/trunk@49089
git-svn-id: http://core.svn.wordpress.org/trunk@48851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-03 01:22:11 +00:00
TimothyBlynJacobs
e9b5b1a5bc
REST API: Allow for string ids in the search controller.
...
Previously, the search controller infrastructure required that the id property was an integer. This prevents data models that use a string id from utilizing the search infrastructure.
This commit lifts the restraint that search handlers return integer ids. This will allow for the Post Formats search handler coming in 5.6 to use slugs instead of creating fake ids.
Props stoyangeorgiev.
Fixes #51131 .
Built from https://develop.svn.wordpress.org/trunk@49088
git-svn-id: http://core.svn.wordpress.org/trunk@48850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-02 17:47:09 +00:00
Adam Silverstein
f426a1fa04
Media: clear inputs after cropping on attachment details screen.
...
Clear the crop selection input fields after the crop action is complete.
Fixes unexpected re-cropping behavior if the crop button was clicked more than once.
Props davidbinda.
Fixes #30155 .
Built from https://develop.svn.wordpress.org/trunk@49087
git-svn-id: http://core.svn.wordpress.org/trunk@48849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-02 15:11:06 +00:00
Sergey Biryukov
f880f14080
Coding Standards: Make checks for an empty post in wp-includes/post.php
more consistent.
...
See #50767 .
Built from https://develop.svn.wordpress.org/trunk@49086
git-svn-id: http://core.svn.wordpress.org/trunk@48848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-02 12:37:06 +00:00
Helen Hou-Sandí
b6641140fd
Tests: Fix a linting error in a test.
...
See #50679 .
Built from https://develop.svn.wordpress.org/trunk@49085
git-svn-id: http://core.svn.wordpress.org/trunk@48847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 21:44:09 +00:00
Helen Hou-Sandí
b108d4db71
Media: Don't unnecessarily check for a valid attachment before getting meta.
...
This makes `wp_get_attachment_metadata()` run significantly faster. See ticket for benchmarking.
Props Tkama, donmhico.
Fixes #50679 .
Built from https://develop.svn.wordpress.org/trunk@49084
git-svn-id: http://core.svn.wordpress.org/trunk@48846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 17:55:06 +00:00
Helen Hou-Sandí
e9d572f431
WP Date: Add timezone abbreviation to wp-date settings.
...
Props mkaz.
Fixes #50624 .
Built from https://develop.svn.wordpress.org/trunk@49083
git-svn-id: http://core.svn.wordpress.org/trunk@48845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 17:43:08 +00:00
TimothyBlynJacobs
69b9b23c49
REST API: Support the patternProperties JSON Schema keyword.
...
Props yakimun.
Fixes #51024 .
Built from https://develop.svn.wordpress.org/trunk@49082
git-svn-id: http://core.svn.wordpress.org/trunk@48844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 02:49:12 +00:00
Sergey Biryukov
0d52ba511c
Docs: Add missing @since
entry for _should_load_block_editor_scripts_and_styles()
.
...
Follow-up to [49080].
See #51330 .
Built from https://develop.svn.wordpress.org/trunk@49081
git-svn-id: http://core.svn.wordpress.org/trunk@48843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 01:14:04 +00:00
noisysocks
96f963a2b9
Editor: Add should_load_block_editor_scripts_and_styles
...
Adds a new should_load_block_editor_scripts_and_styles filter which can be used
by plugins including Gutenberg to more precisely customise when block editor
scripts and styles should be loaded by script-loader.php. Previously, plugins
had to fiddle with $current_screen->is_block_editor().
Props zieladam.
See #51330 .
Built from https://develop.svn.wordpress.org/trunk@49080
git-svn-id: http://core.svn.wordpress.org/trunk@48842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 00:39:04 +00:00
Sergey Biryukov
ca7063fd60
Script Loader: Update versions for MediaElement.js and related files.
...
Follow-up to [49070].
See #51315 .
Built from https://develop.svn.wordpress.org/trunk@49079
git-svn-id: http://core.svn.wordpress.org/trunk@48841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 00:04:05 +00:00
John Blackbourn
1079647d30
Docs: Various docblock improvements related to user and site signup functionality.
...
See #50768
Built from https://develop.svn.wordpress.org/trunk@49078
git-svn-id: http://core.svn.wordpress.org/trunk@48840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 21:54:07 +00:00
Sergey Biryukov
f7ba7c931c
Build/Test Tools: Remove PHP 8 from allowed failures.
...
With all known unit test issues now addressed, WordPress 5.6 aims to support PHP 8 as much as possible.
See #50913 , #50902 .
Built from https://develop.svn.wordpress.org/trunk@49077
git-svn-id: http://core.svn.wordpress.org/trunk@48839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 16:05:06 +00:00
Sergey Biryukov
829fc28a93
Code Modernization: Ignore the _multiwidget
property when collecting widget numbers in WP_Customize_Manager::import_theme_starter_content()
.
...
PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison
In particular, when calling `max()` on an array with numeric values and a non-numeric string, in PHP 8 the string is returned instead of a number.
For `::import_theme_starter_content()`, this resulted in retrieving the `_multiwidget` property instead of the maximum widget number for a particular type.
By explicitly ignoring the `_multiwidget` property, we make sure to retrieve the correct widget number value.
Follow-up to [48960], [49043].
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49076
git-svn-id: http://core.svn.wordpress.org/trunk@48838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 15:46:08 +00:00
Sergey Biryukov
09570be924
Docs: Fix typos in some DocBlocks in js/_enqueues/wp/api.js
.
...
Additionally, rename a variable for clarity.
Props mukesh27.
Fixes #51420 .
Built from https://develop.svn.wordpress.org/trunk@49075
git-svn-id: http://core.svn.wordpress.org/trunk@48837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 13:54:06 +00:00
Sergey Biryukov
36c3a480c8
Build/Test Tools: Comment out the xdebug
group test run for PHP 8 for now.
...
Xdebug supports PHP 8 only from version 3.0, which is not released yet.
Once Xdebug 3.0 is released and included in the Docker image, this should be uncommented again.
Follow-up to [48957], [49037].
See #50913 , #50902 .
Built from https://develop.svn.wordpress.org/trunk@49074
git-svn-id: http://core.svn.wordpress.org/trunk@48836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 13:14:04 +00:00
Sergey Biryukov
bdccfa3a03
Code Modernization: Check if the file to retrieve metadata from in get_file_data()
was successfully opened.
...
This avoids a fatal error on PHP 8 caused by passing a `false` value to `fread()`, instead of a file resource.
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49073
git-svn-id: http://core.svn.wordpress.org/trunk@48835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 12:20:03 +00:00
Sergey Biryukov
e43ff0e991
Code Modernization: Return false
from wpdb::query()
if the query was filtered to an empty string using the query
filter.
...
This avoids a fatal error on PHP 8 caused by passing an empty string to `mysqli_query()`, and maintains the current behaviour.
Follow-up to [48980], [48981].
See #50913 , #50639 .
Built from https://develop.svn.wordpress.org/trunk@49072
git-svn-id: http://core.svn.wordpress.org/trunk@48834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 12:09:08 +00:00
Sergey Biryukov
b3b8942dfc
Docs: Correct description for wp_ajax_update_widget()
.
...
Follow-up to [28355].
Props burhandodhy, sabernhardt.
Fixes #44583 .
Built from https://develop.svn.wordpress.org/trunk@49071
git-svn-id: http://core.svn.wordpress.org/trunk@48833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 09:44:09 +00:00
desrosj
f3168fa073
External Libraries: Update MediaElementJS to version 4.2.16.
...
This change brings a handful of bug fixes made since the previous update in [46436]. For a full list of changes included, see https://github.com/mediaelement/mediaelement/compare/4.2.13...4.2.16 .
Props mukesh27, hareesh-pillai, SergeyBiryukov.
Fixes #51315 .
Built from https://develop.svn.wordpress.org/trunk@49070
git-svn-id: http://core.svn.wordpress.org/trunk@48832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-29 15:53:06 +00:00
Sergey Biryukov
d660801d27
Tests: Require imagejpeg()
function in Ajax media editing tests.
...
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
These tests rely on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045], [49050], [49052].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49069
git-svn-id: http://core.svn.wordpress.org/trunk@48831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-29 14:16:07 +00:00
Sergey Biryukov
12a36355e6
Code Modernization: Remove a single trailing percent sign before calling sprintf()
on the $default
parameter in get_theme_mod()
.
...
This avoids a "Missing format specifier at end of string" fatal error on PHP 8, and maintains the current behaviour.
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49068
git-svn-id: http://core.svn.wordpress.org/trunk@48830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-29 10:03:08 +00:00
Sergey Biryukov
41681b29b0
Posts, Post Types: Avoid a PHP notice in wp_get_shortlink()
if the post type is no longer registered.
...
Props apedog.
Fixes #51376 .
Built from https://develop.svn.wordpress.org/trunk@49067
git-svn-id: http://core.svn.wordpress.org/trunk@48829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-28 11:53:08 +00:00
Sergey Biryukov
f1f579199b
Docs: Clarify the false
return value of get_post_type_archive_link()
and get_post_type_archive_feed_link()
.
...
See #50768 .
Built from https://develop.svn.wordpress.org/trunk@49066
git-svn-id: http://core.svn.wordpress.org/trunk@48828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-28 11:12:03 +00:00
Sergey Biryukov
249451fe08
Docs: Correct formatting for the autosave()
function return value in js/_enqueues/wp/autosave.js
.
...
Props dilipbheda, mukesh27.
Fixes #51401 .
Built from https://develop.svn.wordpress.org/trunk@49065
git-svn-id: http://core.svn.wordpress.org/trunk@48827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-28 10:46:05 +00:00
Sergey Biryukov
2cbcc5d548
Media: Make the "Copy URL" button implementation more consistent with other instances in core:
...
* Make the "Copied!" text green.
* Make the button verbiage clear that it's copied "to clipboard".
Props garrett-eclipse, mukesh27.
Fixes #51355 .
Built from https://develop.svn.wordpress.org/trunk@49064
git-svn-id: http://core.svn.wordpress.org/trunk@48826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 20:48:05 +00:00
TimothyBlynJacobs
bed5797cf6
REST API: Support the multipleOf JSON Schema keyword.
...
Props yakimun.
Fixes #51022 .
Built from https://develop.svn.wordpress.org/trunk@49063
git-svn-id: http://core.svn.wordpress.org/trunk@48825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 19:03:05 +00:00
Sergey Biryukov
6bdbb8b25c
Media: Check if the item is defined before setting the skipHistory
property in media frame router.
...
This avoids a JS error when refreshing the "Attachment details" modal for an item that is not currently queried.
Follow-up to [41021].
Props Mista-Flo, mukesh27.
Fixes #51395 .
Built from https://develop.svn.wordpress.org/trunk@49062
git-svn-id: http://core.svn.wordpress.org/trunk@48824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 08:50:06 +00:00
Sergey Biryukov
c298458751
Docs: Add missing @return
tags for some WP_Automatic_Updater
methods:
...
* `::is_vcs_checkout()`
* `::should_update()`
* `::send_core_update_notification_email()`
Props ankitmaru, mukesh27.
Fixes #51385 .
Built from https://develop.svn.wordpress.org/trunk@49061
git-svn-id: http://core.svn.wordpress.org/trunk@48823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 08:36:06 +00:00
Sergey Biryukov
d36da091c4
Taxonomy: Restore documentation for the taxonomy
parameter of wp_list_categories()
.
...
The parameter's default value is different from the one in `WP_Term_Query::__construct()`, and should be documented accordingly.
This also clarifies that the `taxonomy` parameter of `wp_list_categories()` only accepts a string, not an array.
Follow-up to [40903], [41767], [45894], [45895].
Props grapplerulrich, mukesh27, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51378 . See #47896 .
Built from https://develop.svn.wordpress.org/trunk@49060
git-svn-id: http://core.svn.wordpress.org/trunk@48822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 08:19:04 +00:00
Sergey Biryukov
5c3a734df0
Docs: Correct description for the taxonomy
parameter of wp_dropdown_categories()
.
...
Follow-up to [40903], [41767].
Props grapplerulrich, mukesh27, TimothyBlynJacobs.
See #51378 .
Built from https://develop.svn.wordpress.org/trunk@49059
git-svn-id: http://core.svn.wordpress.org/trunk@48821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 07:49:06 +00:00
Sergey Biryukov
a8b070b56b
Docs: Fix typo in a comment in js/media/routers/manage.js
.
...
Props mukesh27, garrett-eclipse.
Fixes #51397 .
Built from https://develop.svn.wordpress.org/trunk@49058
git-svn-id: http://core.svn.wordpress.org/trunk@48820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 07:38:05 +00:00
Sergey Biryukov
bf2edf9cab
External Libraries: Backport a commit from sodium_compat trunk to fix a PHP 8 error.
...
This addresses an "Undefined constant `MB_OVERLOAD_STRING`" fatal error in the `ParagonIE_Sodium_Core_Util::isMbStringOverride()` method.
In PHP 8, the `MB_OVERLOAD_STRING` constant has been removed, along with the `mbstring` function overloading feature.
Fixes #51399 .
Built from https://develop.svn.wordpress.org/trunk@49057
git-svn-id: http://core.svn.wordpress.org/trunk@48819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 05:17:05 +00:00
Sergey Biryukov
67752b98e0
Upgrade/Install: Update sodium_compat to v1.13.0.
...
This includes a few autoloader fixes and improvements.
A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.12.1...v1.13.0
See #51399 .
Built from https://develop.svn.wordpress.org/trunk@49056
git-svn-id: http://core.svn.wordpress.org/trunk@48818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 04:46:05 +00:00
TimothyBlynJacobs
0db3f859ea
Add ircs and irc6 to the list of allowed protocols.
...
This adds support for the secure and ipv6 variants of the already allowed irc protocol.
Props arealnobrainer, markparnell, ctmartin.
Built from https://develop.svn.wordpress.org/trunk@49055
git-svn-id: http://core.svn.wordpress.org/trunk@48817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 21:02:04 +00:00
TimothyBlynJacobs
bf397c8d89
REST API: Correct @since version after [49053].
...
See #51023 .
Built from https://develop.svn.wordpress.org/trunk@49054
git-svn-id: http://core.svn.wordpress.org/trunk@48816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 18:56:04 +00:00
TimothyBlynJacobs
9951662ebb
REST API: Support the minProperties and maxProperties JSON Schema keywords.
...
Props yakimun.
Fixes #51023 .
Built from https://develop.svn.wordpress.org/trunk@49053
git-svn-id: http://core.svn.wordpress.org/trunk@48815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 18:20:07 +00:00
Sergey Biryukov
c9def12900
Tests: Require imagejpeg()
function in WP_Widget_Media_Image::render_media()
test.
...
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
This test relies on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045], [49050].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49052
git-svn-id: http://core.svn.wordpress.org/trunk@48814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 14:52:07 +00:00
Sergey Biryukov
2e56bb91a8
Tests: Correct assertion in WP_Test_REST_Comments_Controller::check_comment_data()
.
...
`author_avatar_urls` should be present in the comment data array keys, not values.
The test only passed accidentally due to `assertContains()` not performing a strict type check.
See #38266 , #50913 .
Built from https://develop.svn.wordpress.org/trunk@49051
git-svn-id: http://core.svn.wordpress.org/trunk@48813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 03:14:07 +00:00
Sergey Biryukov
cd1f30e28d
Tests: Require imagejpeg()
function in one more media test.
...
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
This test relies on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49050
git-svn-id: http://core.svn.wordpress.org/trunk@48812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 02:34:06 +00:00
Sergey Biryukov
346794bc57
Upload: Add a check in wp_check_filetype_and_ext()
to account for CSV files having the application/csv
MIME type.
...
Previously, the PHP Fileinfo extension used to detect CSV files as `text/plain`.
In PHP 8, this has changed, and CSV files are detected as `application/csv`.
Follow-up to [44438].
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49049
git-svn-id: http://core.svn.wordpress.org/trunk@48811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 01:11:09 +00:00
John Blackbourn
eaf325e386
Upgrade/Install: Introduce the wp_installed_email
filter for filtering the contents of the email sent when WordPress is installed, without needing to override the wp_new_blog_notification()
pluggable function.
...
Props Dharm1025, nikolam, johnbillion
Fixes #42133
Built from https://develop.svn.wordpress.org/trunk@49048
git-svn-id: http://core.svn.wordpress.org/trunk@48810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 22:33:08 +00:00
Sergey Biryukov
fe9e57c1c3
Tests: Require imagejpeg()
function in some REST API attachments controller tests.
...
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
These tests rely on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49047
git-svn-id: http://core.svn.wordpress.org/trunk@48809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 02:23:04 +00:00
Sergey Biryukov
5d31e4368e
Tests: Correct the check for image sizes in some REST API attachments controller tests.
...
If the sizes data could not be retrieved, the controller returns an empty object instead of an array.
This makes sure that the value is in fact an array before proceeding, and outputs a proper message in case of failure, instead of an obscure PHP error further in the test.
Follow-up to [49044].
See #50913 , #51393 .
Built from https://develop.svn.wordpress.org/trunk@49046
git-svn-id: http://core.svn.wordpress.org/trunk@48808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 02:11:03 +00:00
Sergey Biryukov
0485a4ad01
Tests: Require imagejpeg()
function in some more media tests.
...
This outputs a proper message if the requirement is not met, instead of an obscure PHP error further in the test.
These tests rely on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49045
git-svn-id: http://core.svn.wordpress.org/trunk@48807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 01:45:04 +00:00
Sergey Biryukov
312f42f375
Tests: Check if image sizes were successfully retrieved in some REST API attachments controller tests.
...
This outputs a proper message in case of failure, instead of an obscure PHP error further in the test.
Props TimothyBlynJacobs.
See #50913 , #51393 .
Built from https://develop.svn.wordpress.org/trunk@49044
git-svn-id: http://core.svn.wordpress.org/trunk@48806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 01:31:04 +00:00
Sergey Biryukov
4f8f42747f
Code Modernization: Correct the check for parent
argument in wp_insert_term()
and wp_update_term()
.
...
PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison
In particular, checking if a non-empty, non-numeric string is greater than zero in PHP 8 evaluates to `true`, not `false`.
For `wp_insert_term()`, this resulted in a "Parent term does not exist" error for a non-numeric string, instead of discarding the value.
By explicitly casting the value to `int`, we make sure to compare both values as numbers, rather than a string and a number.
Follow-up to [29196], [29830], [29867].
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49043
git-svn-id: http://core.svn.wordpress.org/trunk@48805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 00:04:04 +00:00
Sergey Biryukov
cfe5b1c9f2
Docs: Add a @since
note to wp_privacy_exports_dir
and wp_privacy_exports_url
filters about exports using relative paths since WordPress 5.5.
...
When changing exports location via these filters, make sure to migrate the files to the new directory, to avoid breaking any existing exports.
Follow-up to [48127], [48330].
Props garrett-eclipse.
Fixes #51361 .
Built from https://develop.svn.wordpress.org/trunk@49042
git-svn-id: http://core.svn.wordpress.org/trunk@48804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-24 05:00:06 +00:00
noisysocks
8fa8aad136
Documentation: Add 'template' arg documentation
...
Add inline documentation for the 'template' arg accepted by
register_post_type().
Props milana_cap.
See #46261 .
Built from https://develop.svn.wordpress.org/trunk@49041
git-svn-id: http://core.svn.wordpress.org/trunk@48803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-24 03:12:04 +00:00
noisysocks
41b456eca9
Editor: Hide Screen Options tab from block editor
...
The block editor provides its own interface for managing screen options, so we
can safely hide Screen Options tab found in the top right of the page.
Props aduth.
See #46157 .
Built from https://develop.svn.wordpress.org/trunk@49040
git-svn-id: http://core.svn.wordpress.org/trunk@48802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-24 03:00:08 +00:00
Sergey Biryukov
c10acd850e
Build/Test Tools: Use trunk revision 2387243 of the WordPress Importer plugin.
...
This revision includes a change to only call `libxml_disable_entity_loader()` in PHP < 8, in order for unit tests in the `import` group to pass on PHP 8.
This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is disabled by default, so this function is no longer needed to protect against XXE attacks.
Follow-up to [46542], [48789].
Props jrf.
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49039
git-svn-id: http://core.svn.wordpress.org/trunk@48801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 18:39:07 +00:00
Sergey Biryukov
5c1889f3d8
Docs: Remove obsolete $wpdb
global reference from get_site_by_path()
.
...
Follow-up to [37628].
Props ravivaddweb, mukesh27.
Fixes #51380 .
Built from https://develop.svn.wordpress.org/trunk@49038
git-svn-id: http://core.svn.wordpress.org/trunk@48800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 14:11:07 +00:00
Sergey Biryukov
a610519297
Tests: Backport two changes from PHPUnit 9.3:
...
* Replace the `Match` interface with `ParametersMatch`, to avoid parse errors due to `match` being a reserved keyword in PHP 8.
* Replace `ReflectionParameter::getClass()` usage, which is deprecated in PHP 8.
This allows tests relying on the `getMockForAbstractClass()` and `getMockBuilder()` methods to run again on PHP 8.
When the test suite is updated for compatibility with PHPUnit 9.x, these overrides can be removed.
Follow-up to [48972].
See #50913 , #50902 .
Built from https://develop.svn.wordpress.org/trunk@49037
git-svn-id: http://core.svn.wordpress.org/trunk@48799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 13:54:07 +00:00
Sergey Biryukov
d4a319c453
Users: Check if the user ID passed as selected
to wp_dropdown_users()
corresponds to an existing user.
...
This avoids a few PHP notices if the `include_selected` parameter was specified and a non-existing user ID was passed.
Props campusboy1987.
Fixes #51370 .
Built from https://develop.svn.wordpress.org/trunk@49036
git-svn-id: http://core.svn.wordpress.org/trunk@48798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 00:27:07 +00:00
desrosj
a16faa6989
Privacy: Ensure bulk action related strings end with periods.
...
Props garrett-eclipse, mukesh27.
Fixes #51371 .
Built from https://develop.svn.wordpress.org/trunk@49035
git-svn-id: http://core.svn.wordpress.org/trunk@48797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 18:40:04 +00:00
desrosj
6ff2fbb6cd
External Libraries: Upgrade PHPMailer to version 6.1.7.
...
For a full list of changes in this update, see the PHPMailer GitHub: https://github.com/PHPMailer/PHPMailer/compare/v6.1.6...v6.1.7 .
Props ayeshrajans, jrf.
Fixes #51311 .
Built from https://develop.svn.wordpress.org/trunk@49034
git-svn-id: http://core.svn.wordpress.org/trunk@48796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 18:37:08 +00:00
Sergey Biryukov
b7431cfa83
Tests: Use consistent trailing punctuation in fail()
messages.
...
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@49033
git-svn-id: http://core.svn.wordpress.org/trunk@48795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 12:34:04 +00:00
Sergey Biryukov
d9346ea967
Tests: Check if image metadata for a particular size was successfully retrieved in some media tests.
...
This outputs a proper message in case of failure, instead of an obscure PHP error further in the test.
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49032
git-svn-id: http://core.svn.wordpress.org/trunk@48794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 12:32:07 +00:00
TimothyBlynJacobs
883ace38f1
REST API: Regenerate test fixtures after [48982].
...
Props garrett-eclipse.
Fixes #50805 .
Built from https://develop.svn.wordpress.org/trunk@49031
git-svn-id: http://core.svn.wordpress.org/trunk@48793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 22:54:06 +00:00
Sergey Biryukov
5d99107bf3
Tests: Fix typo in some markTestSkipped()
messages.
...
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@49030
git-svn-id: http://core.svn.wordpress.org/trunk@48792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 20:20:07 +00:00
John Blackbourn
175c2c5b7c
Users: Introduce the invited_user_email
filter for filtering the contents of the email sent when an existing user is invited to a site on Multisite.
...
Props contact-banker, anand.au14, nikolam, johnbillion
Fixes #42132
Built from https://develop.svn.wordpress.org/trunk@49029
git-svn-id: http://core.svn.wordpress.org/trunk@48791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 17:16:07 +00:00
John Blackbourn
aef504acfd
Docs: Correct the indentation for some array type docs.
...
See #50768
Built from https://develop.svn.wordpress.org/trunk@49028
git-svn-id: http://core.svn.wordpress.org/trunk@48790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 16:46:06 +00:00
Sergey Biryukov
790983eca4
Tests: Use consistent trailing punctuation in markTestSkipped()
messages.
...
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@49027
git-svn-id: http://core.svn.wordpress.org/trunk@48789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 14:07:05 +00:00
Sergey Biryukov
29c0edfbba
Privacy: Check if the accumulated data in wp_privacy_process_personal_data_export_page()
is not empty.
...
This avoids an error on PHP 8 caused by passing an empty string to `array_merge()`, instead of an array.
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49026
git-svn-id: http://core.svn.wordpress.org/trunk@48788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 13:51:03 +00:00
Sergey Biryukov
a95e9a91da
Tests: Convert a few more function_exists()
and extension_loaded()
checks to @requires
annotations.
...
This better utilizes the PHPUnit native functionality.
Follow-up to [49024].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49025
git-svn-id: http://core.svn.wordpress.org/trunk@48787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 13:27:02 +00:00
Sergey Biryukov
1e39e21616
Tests: Convert the checks for imagejpeg()
function availability to use the @requires
annotation.
...
This better utilizes the PHPUnit native functionality.
Props ayeshrajans, jrf, johnbillion.
Fixes #50639 . See #50640 .
Built from https://develop.svn.wordpress.org/trunk@49024
git-svn-id: http://core.svn.wordpress.org/trunk@48786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 11:36:04 +00:00
Sergey Biryukov
6e5ca746e1
General: Give the $is
variable in is_wp_error()
a more descriptive name.
...
Follow-up to [49022].
See #40568 .
Built from https://develop.svn.wordpress.org/trunk@49023
git-svn-id: http://core.svn.wordpress.org/trunk@48785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 11:13:05 +00:00
John Blackbourn
964d0784be
General: Introduce the wp_error_added
and wp_error_checked
actions.
...
These actions allow debugging tools to track `WP_Error` instances as they're created and subsequently passed between functions which check for error objects.
Props Shelob9, Mte90, TimothyBlynJacobs, johnbillion
Fixes #40568
Built from https://develop.svn.wordpress.org/trunk@49022
git-svn-id: http://core.svn.wordpress.org/trunk@48784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 17:44:07 +00:00
John Blackbourn
aba2165aae
Media: Standardise the description for image size parameters.
...
This brings continuity to all the image related functions and filters which accept or pass a size parameter.
Props dilipbheda, johnbillion
Fixes #47364
Built from https://develop.svn.wordpress.org/trunk@49021
git-svn-id: http://core.svn.wordpress.org/trunk@48783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 16:23:07 +00:00
John Blackbourn
0b2e31a7f8
Docs: Inline documentation improvements for media related functions and hooks.
...
See #47364 , #50768
Built from https://develop.svn.wordpress.org/trunk@49020
git-svn-id: http://core.svn.wordpress.org/trunk@48782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 15:55:10 +00:00
Sergey Biryukov
2884b7b1b7
Media: Return a WP_Error
from WP_Image_Editor_GD::load()
if file contents could not be retrieved.
...
This avoids an error on PHP 8 caused by calling `imagecreatefromstring()` on an empty result.
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49019
git-svn-id: http://core.svn.wordpress.org/trunk@48781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 14:28:05 +00:00
Sergey Biryukov
8752dbaaba
Tests: Correctly unset non-supported image editor engines in some image tests.
...
Follow-up to [49009], [49014].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49018
git-svn-id: http://core.svn.wordpress.org/trunk@48780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 14:15:03 +00:00
John Blackbourn
43b11121de
Media: Correct some types for attachment ID parameters passed to functions and filters.
...
See #47364 , #50768
Built from https://develop.svn.wordpress.org/trunk@49017
git-svn-id: http://core.svn.wordpress.org/trunk@48779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 14:05:05 +00:00
John Blackbourn
e22107ce4e
Media: Correct some types in docblocks for filters related to thumbnails.
...
Props dilipbheda
See #47364 , #50768
Built from https://develop.svn.wordpress.org/trunk@49016
git-svn-id: http://core.svn.wordpress.org/trunk@48778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:40:04 +00:00
Sergey Biryukov
e6fd778208
Tests: Use more specific assertions in Tests_Image_Functions::test_load_directory()
.
...
This avoids an error on PHP 8 caused by calling `get_resource_type()` on a string.
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49015
git-svn-id: http://core.svn.wordpress.org/trunk@48777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:33:04 +00:00
Sergey Biryukov
a29b071f80
Tests: Optimize some image tests to avoid checking for image editor engines availability twice.
...
Follow-up to [49009].
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49014
git-svn-id: http://core.svn.wordpress.org/trunk@48776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:27:05 +00:00
John Blackbourn
7d61c45afc
I18N: Add a language icon next to the Default Language network option.
...
Fixes #51359
Built from https://develop.svn.wordpress.org/trunk@49013
git-svn-id: http://core.svn.wordpress.org/trunk@48775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:18:05 +00:00
John Blackbourn
ecfff6fe80
Media: Correct the image thumbnail logic in media templates.
...
This ensures the correct data properties are checked before displaying image thumbnails.
Props chetan200891
Fixes #49655
Built from https://develop.svn.wordpress.org/trunk@49012
git-svn-id: http://core.svn.wordpress.org/trunk@48774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:15:04 +00:00
John Blackbourn
123806ff28
Themes: Remove the ability to delete themes from the single site Appearance screen on Multisite installations.
...
This brings theme deletion inline with plugin deletion and theme and plugin editing, which can only be performed from within Network Admin.
Props Mista-Flo, williampatton, johnbillion
Fixes #41441
Built from https://develop.svn.wordpress.org/trunk@49011
git-svn-id: http://core.svn.wordpress.org/trunk@48773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 12:03:05 +00:00
Sergey Biryukov
e8f35359d7
Tests: Consistently require imagejpeg()
function in image_make_intermediate_size()
tests.
...
This outputs a proper message if the requirement is not met, instead of an obscure PHP error further in the test.
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49010
git-svn-id: http://core.svn.wordpress.org/trunk@48772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 03:33:05 +00:00
Sergey Biryukov
795e4ebd31
Tests: Skip some image tests if neither GD nor Imagick image editor engines are supported on the system.
...
The explicit message brings some consistency with other image editor tests, specifically the ones using the `WP_Image_UnitTestCase` class.
Previously, the tests were marked as "risky" in that scenario, due to performing no assertions.
See #50639 , #50640 .
Built from https://develop.svn.wordpress.org/trunk@49009
git-svn-id: http://core.svn.wordpress.org/trunk@48771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 02:47:05 +00:00
Sergey Biryukov
8791de899a
Coding Standards: Fix WPCS issue in [49007].
...
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49008
git-svn-id: http://core.svn.wordpress.org/trunk@48770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 01:18:04 +00:00
Sergey Biryukov
9e3b5d2f12
Tests: Fix the failures in REST API format
keyword validation tests on PHP 8.
...
The tests ensure that `rest_sanitize_value_from_schema()` and `rest_validate_value_from_schema()` throw an "undefined offset" notice when the required `type` schema keyword is not passed.
In PHP 8, that notice is now a warning, so the tests need to be adjusted accordingly.
Follow-up to [48300], [48993].
See #50913 .
Built from https://develop.svn.wordpress.org/trunk@49007
git-svn-id: http://core.svn.wordpress.org/trunk@48769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 00:57:06 +00:00
Sergey Biryukov
4ae2bafafd
Tests: Add missing @covers
tags for files in phpunit/tests/functions/
.
...
Props pbearne, jrf.
See #39265 .
Built from https://develop.svn.wordpress.org/trunk@49006
git-svn-id: http://core.svn.wordpress.org/trunk@48768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 15:54:03 +00:00
Sergey Biryukov
9bb4b76044
Tests: Speed up slashed data tests by reusing some more shared fixtures.
...
Follow-up to [35249], [49003].
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@49005
git-svn-id: http://core.svn.wordpress.org/trunk@48767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 11:12:04 +00:00
Sergey Biryukov
b27ebaa269
Coding Standards: Give the $id
variable in slashed data tests a more descriptive name.
...
See #50767 , #51344 .
Built from https://develop.svn.wordpress.org/trunk@49004
git-svn-id: http://core.svn.wordpress.org/trunk@48766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 10:55:05 +00:00
Sergey Biryukov
54fe0e0698
Tests: Speed up slashed data tests by reusing shared fixtures.
...
Follow-up to [35249].
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@49003
git-svn-id: http://core.svn.wordpress.org/trunk@48765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 10:36:03 +00:00
Sergey Biryukov
c50c266e51
Tests: Speed up tests for wp_allow_comment()
by reusing shared fixtures.
...
Props frank-klein.
Fixes #51216 .
Built from https://develop.svn.wordpress.org/trunk@49002
git-svn-id: http://core.svn.wordpress.org/trunk@48764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 09:27:06 +00:00
Sergey Biryukov
f2a2ffbf2c
Tests: Simplify the logic in WP_UnitTestCase_Base::setUpBeforeClass()
and ::tearDownAfterClass()
.
...
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@49001
git-svn-id: http://core.svn.wordpress.org/trunk@48763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 09:13:07 +00:00
Peter Wilson
b1505c2d9c
Posts, Post Types: Ensure default terms are added by wp_publish_post()
.
...
Transitioning posts from `auto-draft` to `publish` via `wp_publish_post()` could result in published posts without the default category or custom taxonomy default terms.
Props frank-klein, TimothyBlynJacobs, peterwilsoncc.
Fixes #51292 .
Built from https://develop.svn.wordpress.org/trunk@49000
git-svn-id: http://core.svn.wordpress.org/trunk@48762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 01:22:08 +00:00
Sergey Biryukov
88ea2929b7
Tests: Simplify PluralFormsTest::test_exceptions()
.
...
Previously, the test had to use an older pattern for catching the generic `Exception` exceptions for compatibility with PHPUnit 3.6 on PHP 5.2.
Now that WordPress supports PHPUnit 5.4 as the minimum version, the `expectException()` method can be used directly.
Follow-up to [41725], [41730].
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@48999
git-svn-id: http://core.svn.wordpress.org/trunk@48761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 14:13:03 +00:00
Sergey Biryukov
0e0c620dee
Docs: Update the code example in WP_Ajax_UnitTestCase::dieHandler()
DocBlock to use expectException()
.
...
Follow-up to [48996], [48997].
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@48998
git-svn-id: http://core.svn.wordpress.org/trunk@48760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 13:55:04 +00:00
Sergey Biryukov
b69db72a08
Tests: Switch Ajax tests to use the expectException()
method directly, instead of the WP_UnitTestCase_Base::setExpectedException()
wrapper.
...
This brings some consistency with other tests.
Follow-up to [48996].
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@48997
git-svn-id: http://core.svn.wordpress.org/trunk@48759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 13:50:04 +00:00
Sergey Biryukov
e42779f9a0
Tests: Consistently use the expectException()
method instead of the older @expectedException
annotation.
...
See https://thephp.cc/news/2016/02/questioning-phpunit-best-practices
The method is available since PHPUnit 5.2, and WordPress currently supports PHPUnit 5.4 as the minimum version.
Follow-up to [48993].
See #51344 .
Built from https://develop.svn.wordpress.org/trunk@48996
git-svn-id: http://core.svn.wordpress.org/trunk@48758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 13:24:07 +00:00