Fixes a bug where cached events & location data was not accessible because the
cache key could not be regenerated without latitude and longitude information.
Discovered and fixed during #wcber contributor day.
Props soean, kubik-rubik, obenland.
See #40702.
Built from https://develop.svn.wordpress.org/trunk@40651
git-svn-id: http://core.svn.wordpress.org/trunk@40514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These controls toggle the visibility of the update progress: they perform an action
therefore they should be buttons. Also:
- uses `aria-expanded` to communicate the toggle button state
- removes some inline JavaScript
- when clicking the toggle buttons, the progress details get moved with JavaScript after the button: this helps users of assistive technologies in finding them and makes the UI a bit more intuitive
Props Cheffheid, afercia.
See #26504.
Fixes#40453.
Built from https://develop.svn.wordpress.org/trunk@40646
git-svn-id: http://core.svn.wordpress.org/trunk@40507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This offscreen text is not meant to be revealed on focus and just acts as fallback
for assistive technologies that don't support `aria-label` and `role="slider"`.
Also, revealing it on focus has proven over time to be very fragile and to cause
unexpected layout issues.
See #30281.
Fixes#40707.
Built from https://develop.svn.wordpress.org/trunk@40642
git-svn-id: http://core.svn.wordpress.org/trunk@40503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The last time a new widget was introduced, Vuvuzelas were a thing, Angry Birds started taking over phones, and WordPress stopped shipping with Kubrick. Seven years and 17 releases without new widgets have been enough, time to spice up your sidebar!
Props westonruter, melchoyce, obenland, timmydcrawford, adamsilverstein, gonom9, wonderboymusic, Fab1en, DrewAPicture, sirbrillig, joen, matias, samikeijonen, afercia, celloexpressions, designsimply, michelleweber, ranh, kjellr, karmatosed.
Fixes#32417, #39993, #39994, #39995.
Built from https://develop.svn.wordpress.org/trunk@40640
git-svn-id: http://core.svn.wordpress.org/trunk@40501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
During a PHPUnit test suite run, a file named `wp-api-generated.js` is created which contains some response objects that serve as fixtures for the `wp-api.js` client unit tests.
Previously, some of these API responses were actually error objects, which isn't what we want for testing. This commit fixes the existing error responses and prevents this situation in the future.
Fixes#40734.
Built from https://develop.svn.wordpress.org/trunk@40629
git-svn-id: http://core.svn.wordpress.org/trunk@40490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates Twemoji and adds a second Emoji 4 test to include a shrugging man. Emoji 4 is being implemented gradually, while some browsers now support the female technologist, the indifferent shrugging man is breaking things with his presence.
Props peterwilsoncc, pento for code review.
Fixes#40615.
Built from https://develop.svn.wordpress.org/trunk@40626
git-svn-id: http://core.svn.wordpress.org/trunk@40487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Now that Travis has confirmed that it is sending messages to Slack when a test fails, we no longer need a failing test.
The failing test added in [40613] is reverted, as Travis has failed to fail at notifying us about failing tests.
See #40712.
Built from https://develop.svn.wordpress.org/trunk@40614
git-svn-id: http://core.svn.wordpress.org/trunk@40484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
To ensure that Travis is sending messages to Slack, a test needs to fail, so here's a failing test.
This failing test (and no other failing tests) will be reverted once Travis confirms that it isn't failing to message Slack about failing tests.
See #40712.
Built from https://develop.svn.wordpress.org/trunk@40613
git-svn-id: http://core.svn.wordpress.org/trunk@40483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prior to this change, after creating a site, the network site count was always refreshed on the current network, regardless of whether the site was created on a different network. With the recent changes, particularly [40591], it is now possible to update the site count for a specific `$network_id`, so this changeset makes use of the new parameter.
Fixes#38699.
Built from https://develop.svn.wordpress.org/trunk@40612
git-svn-id: http://core.svn.wordpress.org/trunk@40482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The unit tests introduced as part of [40486] used the wrong `site_count` network option name instead of `blog_count`. This did not cause actual issues in the tests, but deleting the option was supposed to verify that it is properly recreated afterwards. The usage of the wrong name made these tests less useful, so this changeset fixes it.
Fixes#40725.
Built from https://develop.svn.wordpress.org/trunk@40611
git-svn-id: http://core.svn.wordpress.org/trunk@40481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The unit test introduced in [40370] used the strict `assertSame()` check while comparison a count with the value of an option, which under most conditions is not an integer. While the test passed on some setups, it failed on others. This changeset ensures that `assertEquals()` is used to make the test stable.
Fixes#40724.
Built from https://develop.svn.wordpress.org/trunk@40610
git-svn-id: http://core.svn.wordpress.org/trunk@40480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Now that the `WordPress/wordpress-develop` GitHub repo is syncing correctly, we can use it for Travis integration.
Props jorbin for getting the ball rolling so long ago, unprops jorbin because his Travis build can finally be retired.
Fixes#40712.
Built from https://develop.svn.wordpress.org/trunk@40604
git-svn-id: http://core.svn.wordpress.org/trunk@40474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Browsers send an "Origin: null" header value for file and data URLs, as they can be generated by any document, and their origin is not guaranteed. Since we want to allow any URL to access the API (intentionally disabling the CORS protections), we need to special-case the non-URL "null" value.
Props joehoyle.
Fixes#40011.
Built from https://develop.svn.wordpress.org/trunk@40600
git-svn-id: http://core.svn.wordpress.org/trunk@40470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduces option to `$return` parameter to return the attachment id created after a successful image sideload.
Props slbmeh, kawauso, alexkingorg, SergeyBiryukov, georgestephanis, DrewAPicture, nacin, trepmal, mattheu, kraftbj, whyisjake, dotancohen, MrGregWaugh, danielbachhuber.
Fixes#19629.
Built from https://develop.svn.wordpress.org/trunk@40597
git-svn-id: http://core.svn.wordpress.org/trunk@40467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[40591] and [40593] introduced a `$network_id` parameter for `wp_maybe_update_network_site_counts()` and `wp_maybe_update_network_user_counts()`, as well as [40486] previously added it to `wp_update_network_counts()`. This changeset ensures the filter hooks in `ms-default-filters.php` do not pass any parameter to them that might conflict with their actual `$network_id` parameter, which caused unit test failures before.
Fixes#40703.
Built from https://develop.svn.wordpress.org/trunk@40596
git-svn-id: http://core.svn.wordpress.org/trunk@40466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If an email address is missing an `@`, we can't assume enough to check it against a list of domain names.
Additional validation of email should happen in `is_email()` before being passed to `is_email_address_unsafe()`.
Fixes#39915.
Built from https://develop.svn.wordpress.org/trunk@40595
git-svn-id: http://core.svn.wordpress.org/trunk@40465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Now that `get_blog_count()` and `get_user_count()` both support passing a `$network_id` parameter (see [40370] and [40371]), similar functionality is now available for `wp_is_large_network()`. In addition, the filter `wp_is_large_network` now accepts the network ID as its fourth parameter.
This changeset furthermore introduces unit tests for the `wp_is_large_network()` function and its filter.
Fixes#40489.
Built from https://develop.svn.wordpress.org/trunk@40590
git-svn-id: http://core.svn.wordpress.org/trunk@40460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prior to this change, the minimum site name length checked in `wpmu_validate_blog_signup()` was set to a fixed value of 4. The new filter allows tweaking this value, as there may be cases where shorter site names may be required.
Fixes#39676.
Built from https://develop.svn.wordpress.org/trunk@40589
git-svn-id: http://core.svn.wordpress.org/trunk@40459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Previously, the UN flag test relied on the image being produced to be quite small. Unfortunately, the Chrome PNG encoder seems to have changed recently, and it now produces a relatively large image.
For a better test, we can compare the rendering of [U] + [N] against [U] + zero width space + [N].
Fixes#40616.
Built from https://develop.svn.wordpress.org/trunk@40582
git-svn-id: http://core.svn.wordpress.org/trunk@40452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When headers are stored in WP_REST_Request internally they are canonicalized. This step already happens on setting / getting headers in any way, but was missed when implementing remove_header().
Props TimothyBlynJacobs.
Fixes#40347.
Built from https://develop.svn.wordpress.org/trunk@40577
git-svn-id: http://core.svn.wordpress.org/trunk@40447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Valid code is important not just to formally meet the specification, but also to
ensure user agents, including assistive technologies, can accurately interpret
and parse content. When HTML elements are not used in the recommended way,
user agents may render them in unexpected ways. It can also become a problem for
compatibility with older or even future browsers, devices, or other software.
See W3C WCAG 4.1.1.
Props takayukister, aryamaaru.
Fixes#34881.
Built from https://develop.svn.wordpress.org/trunk@40572
git-svn-id: http://core.svn.wordpress.org/trunk@40442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Using the `focus` event on the date and time custom format fields made impossible
to navigate through all the form fields using only the keyboard without actually
selecting the custom format setting. Instead, using `click` and `input` preserves
the original functionality when using any kind of pointing or input device.
Fixes#40515.
Built from https://develop.svn.wordpress.org/trunk@40568
git-svn-id: http://core.svn.wordpress.org/trunk@40436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes the need to manually call `$this->skipWithMultisite()` and `$this->skipWithoutMultisite()` from within the test when the test only runs without Multisite or only runs on Multisite, respectively.
Props jdgrimes for the suggestion.
Fixes#40531
Built from https://develop.svn.wordpress.org/trunk@40564
git-svn-id: http://core.svn.wordpress.org/trunk@40433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This has a slight performance impact on sites with a large number of users when the `time` strategy is used for counting users. Hopefully this impact will be negated by enhancements proposed in #38741.
Props psoluch, dots, boonebgorges, ptbello, tharsheblows
Fixes#29785
Built from https://develop.svn.wordpress.org/trunk@40560
git-svn-id: http://core.svn.wordpress.org/trunk@40429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The test `Tests_Comment_CheckComment::test_should_return_true_when_content_does_not_match_moderation_keys()`
did not, in fact, test for a `true` value, but for a false one.
Switching to `assertTrue()` caused a failure, because the test comment
triggered the 'comment_moderation' test. As in other tests in the file,
the solution is to force 'comment_moderation' to 0 for the purposes of
the test.
Introduced in [32519].
Props stephdau.
Fixes#40584.
Built from https://develop.svn.wordpress.org/trunk@40557
git-svn-id: http://core.svn.wordpress.org/trunk@40426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This brings much needed uniformity to test skipping when a test requires Multisite or when a test should be excluded from running when Multisite is enabled.
Used in conjunction with the `@group ms-required` and `@group ms-excluded` notation, this removes a significant number of skipped tests from the default test suite run.
Fixes#40531
Built from https://develop.svn.wordpress.org/trunk@40543
git-svn-id: http://core.svn.wordpress.org/trunk@40419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds a compatibility shim for the new namespaced structure of PHPUnit and the removed `setExpectedException()` method. In addition, this updates the Travis config so PHPUnit 6.1 is used where appropriate.
Props miyauchi, gitlost.
Fixes#39822
Built from https://develop.svn.wordpress.org/trunk@40536
git-svn-id: http://core.svn.wordpress.org/trunk@40412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Tests in the `ms-excluded` group are now excluded when running tests with multisite enabled, and tests in the `ms-required` group are excluded when running tests without multisite enabled. The end result is a significantly reduced number of skipped tests polluting PHPUnit's output, which means verbose mode can be used to more easily see which tests are skipped or incomplete, and why.
See #40531
Built from https://develop.svn.wordpress.org/trunk@40520
git-svn-id: http://core.svn.wordpress.org/trunk@40396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[7520] introduced an undocumented feature whereby developers could
register a custom taxonomy with an 'args' parameter, consisting of
an array of config params that, when present, override corresponding
params in the `$args` array passed to `wp_get_object_terms()` when
using that function to query for terms in the specified taxonomy.
The `wp_get_object_terms()` refactor in [38667] failed to respect
this secret covenant, and the current changeset atones for the
transgression.
Props danielbachhuber.
Fixes#40496.
Built from https://develop.svn.wordpress.org/trunk@40513
git-svn-id: http://core.svn.wordpress.org/trunk@40389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Using the new parameter, it is now possible to update the user count on a network different from the current one. While the count itself is technically a global user count and not network-wide, it is stored on each individual network, and the new parameter provides more control about where to update the count.
Fixes#40349. See #38699.
Built from https://develop.svn.wordpress.org/trunk@40485
git-svn-id: http://core.svn.wordpress.org/trunk@40361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Links used as UI controls that behave like buttons, should be buttons.
- changes the widgets "toggle", "Delete", and "Close" links to buttons
- uses `aria-expanded` to announce the state of the toggle buttons
- increases a bit the clickable area of the toggle
- ensures the "circular focus" doesn't get cut-off in some browsers by centering the toggle arrows
- uses a `<span>` element with an `aria-hidden` attribute to hide CSS generated font icons from assistive technologies
- standardizes on `.toggle-indicator:before` rather than `:after`
- changes two `#f00` reds in `#dc3232`, see #35622Fixes#31476.
Built from https://develop.svn.wordpress.org/trunk@40480
git-svn-id: http://core.svn.wordpress.org/trunk@40356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The behaviour was previously possible with the `blog_details` filter and `get_blog_details()` function. The former is deprecated since [38936].
This change adjusts the magic methods of `WP_Site` to also check if `$key` exists in `WP_Site::get_details()`.
Fixes#40458.
Built from https://develop.svn.wordpress.org/trunk@40478
git-svn-id: http://core.svn.wordpress.org/trunk@40354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When the posts page is on the front page or within a front page section, the heading hierarchy for the individual post titles needs to be adjusted accordingly.
Props joedolson, celloexpressions, davidakennedy.
Fixes#40264.
Built from https://develop.svn.wordpress.org/trunk@40458
git-svn-id: http://core.svn.wordpress.org/trunk@40334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As a general rule, this means the fastest test jobs now run first because each subsequent version of PHP is faster than the previous. When a committer is patiently waiting for a Travis build to complete, they are at least more likely to see unexpected failures earlier than they otherwise would.
In addition, this updates the JavaScript test job to run on PHP 7.1.
Props netweb
See #39705
Built from https://develop.svn.wordpress.org/trunk@40434
git-svn-id: http://core.svn.wordpress.org/trunk@40332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Fix an issue where legacy JavaScript for SWFUpload still used jQuery's
deprecated `live` event which no longer works - switch to using `on`.
This JavaScript is still used by some plugins and themes.
Props MMDeveloper.
Fixes#39886.
Built from https://develop.svn.wordpress.org/trunk@40431
git-svn-id: http://core.svn.wordpress.org/trunk@40329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This avoids a couple of expensive queries that attempt to determine whether the media library contains any audio or video items, and also makes the UI for creating playlists more discoverable.
[40382] and [40421] added filters to allow overriding this behavior; this commit changes the default value of the filters to always show these UI buttons and never run the expensive queries. The old behavior can still be restored using the filters if desired.
Props sboisvert, adamsilverstein, joemcgill, jnylen0.
Fixes#31071.
Built from https://develop.svn.wordpress.org/trunk@40430
git-svn-id: http://core.svn.wordpress.org/trunk@40328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As a follow-up to [40382], this commit makes the following improvements:
- Make the filter names more specific.
- Fix the inline documentation (use `@param` instead of `@return).
- Use `null ===` instead of `is_null` to avoid extra function calls.
- Rename the `$has_audio` and `$has_video` variables now that they actually represent something slightly different.
See #31071.
Built from https://develop.svn.wordpress.org/trunk@40421
git-svn-id: http://core.svn.wordpress.org/trunk@40319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The Toolbar search field, when the Toolbar is displayed on the frontend, might
inherit CSS properties from the active Theme stylesheet. For example, this
happened with Twenty Seventeen that sets `display: block;` on all the input
fields. Thus, there's the need to reset some CSS properties to avoid inheritance.
Props @sagarprajapati.
Fixes#40313.
Built from https://develop.svn.wordpress.org/trunk@40418
git-svn-id: http://core.svn.wordpress.org/trunk@40316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using `is_super_admin()` in a non-multisite environment, the function is supposed to check for administrator capabilities. The process of querying all users and filtering them with that function can be optimized by only querying users with the administrator role instead.
Fixes#40406. See #37616.
Built from https://develop.svn.wordpress.org/trunk@40406
git-svn-id: http://core.svn.wordpress.org/trunk@40313 1a063a9b-81f0-0310-95a4-ce76da25c4cd