This introduces the `LOCAL_PHPUNIT` environment variable, which allows the desired version of PHPUnit to be specified when running the PHP tests within the local Docker environment.
Because support for newer versions of PHPUnit is not backported, some versions of PHP need the ability to run multiple versions of PHPUnit for different branches. This adds the flexibility needed to use the Docker environment within those older branches to run the PHP tests.
Props johnbillion, SergeyBiryukov.
Merges [49362] to the 5.5 branch.
See #50042.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49363 602fd350-edb4-49c9-b593-d223f7449a82
This prevents an error if constants are not predefined when running the Docker install script while using older combinations of WordPress/PHP/WP-CLI.
Backports [49335] to the 5.5 branch.
See #48301.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49340 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a PHP notice when creating a post with multiple taxonomies both having a default term.
Props yakimun, szaqal21, hareesh-pillai, audrasjb.
Merges [49328] to the 5.5 branch.
Fixes#51320.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49332 602fd350-edb4-49c9-b593-d223f7449a82
This updates the `dealerdirect/phpcodesniffer-composer-installer` package to allow installing version `0.7.0` which supports Composer 2.0.
Props itowhid06, jrf.
Merges [49306] to the 5.5 branch.
See #51624.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49313 602fd350-edb4-49c9-b593-d223f7449a82
This was done for trunk in [49101] as part of other changes, and is now backported to the 5.5 branch.
Follow-up to [49275].
Props iandunn, SergeyBiryukov.
Fixes#51130.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49307 602fd350-edb4-49c9-b593-d223f7449a82
Fix the first step of validating an anonymous commenters in which the length is checked prior to running regular expressions.
Follow up to [47808].
Merges [49271] to the 5.5 branch.
Fixes#51595.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49273 602fd350-edb4-49c9-b593-d223f7449a82
This ensures that the reply heading is updated correctly on single post URLs with the `?replytocom` query argument.
Follow-up to [47506], [48876], [48904].
Props mailnew2ster, wpamitkumar, audrasjb, desrosj, SergeyBiryukov.
Merges [49187] to the 5.5 branch.
Fixes#51175.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49191 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a PHP notice for an undefined index of either `plugin` or `theme` in the `auto_{plugin|theme}_update_send_email` filter hook.
Props afragen, audrasjb.
Merges [49166] to the 5.5 branch.
Fixes#51400.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49167 602fd350-edb4-49c9-b593-d223f7449a82
When the mysql extention isn't loaded and a custom db dropin is not in place, we give folks a nice error. However, we can't assume that the WP_CONTENT_DIR constant is set yet since this runs before we define default constants.
This fixes a PHP8 error.
See: #50913.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@49161 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a PHP notice after submitting the Edit Comment form.
Follow-up to [48050].
Props regan.khadgi.
Merges [48958] to the 5.5 branch.
Fixes#51263.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48959 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a PHP notice when editing an image.
Follow-up to [48375].
Props Mista-Flo.
Merges [48946] to the 5.5 branch.
Fixes#51251.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48956 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a conflict with the same global variable used elsewhere, e.g. in Theme Editor.
Follow-up to [48850].
Props vinayak.anivase.
Merges [48938] to the 5.5 branch.
Fixes#51219.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48955 602fd350-edb4-49c9-b593-d223f7449a82
Add some new tests to better cover the functionality, for consistency with `get_the_date()` and `get_the_time()`.
Follow-up to [48911], [48912], [48918].
Props wittich.
Merges [48924] to the 5.5 branch.
Fixes#51184.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48926 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48923] to the 5.5 branch.
Fixes#51123.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48925 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48918] to the 5.5 branch.
See #51184.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48922 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48912] to the 5.5 branch.
Fixes#51184.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48921 602fd350-edb4-49c9-b593-d223f7449a82
- Move some tests from `post.php` to a more appropriate location in the `date` directory.
- Rename `date/postTime.php` to `date/getPostTime.php` to match the function name.
Props Rarst.
Merges [48911] to the 5.5 branch.
See #51184.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48920 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48913] to the 5.5 branch.
Fixes#51182.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48919 602fd350-edb4-49c9-b593-d223f7449a82
The value is internally used to detect whether nothing has hooked into this filter.
Props audrasjb, pbiron, johnbillion, SergeyBiryukov.
Merges [48909] to the 5.5 branch.
Fixes#50848.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48916 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48910] to the 5.5 branch.
Fixes#51081.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48915 602fd350-edb4-49c9-b593-d223f7449a82
This ensures consistent results in query var tests, regardless of whether they are run in isolation or as part of a larger group of tests.
Props pbiron, peterwilsoncc.
Merges [48908] to the 5.5 branch.
Fixes#51154.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48914 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48894] and [48895] to the 5.5 branch.
Fixes#50992.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48896 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48890] to the 5.5 branch.
Fixes#50919.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48891 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48888] to the 5.5 branch.
Fixes#50988.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48889 602fd350-edb4-49c9-b593-d223f7449a82
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, TimothyBlynJacobs.
Merges [48881] to the 5.5 branch.
Fixes#51146.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48883 602fd350-edb4-49c9-b593-d223f7449a82
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.
Merges [48880] to the 5.5 branch.
Fixes#51137.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48882 602fd350-edb4-49c9-b593-d223f7449a82
`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.
Merges [48876] to the 5.5 branch.
Fixes#38009.
git-svn-id: https://develop.svn.wordpress.org/branches/5.5@48877 602fd350-edb4-49c9-b593-d223f7449a82