Commit Graph

23733 Commits

Author SHA1 Message Date
Andrea Fercia 471f1e7201 Accessibility: Wrap the installed themes search field within a form element.
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
2017-05-05 19:02:45 +00:00
Adam Silverstein 428afdaa5a REST API: Improve strings added after 4.7 string freeze.
Clarify the `rest_orderby_include_missing_include` error message.

Props PranaliPatel.
Fixes #39178.

Built from https://develop.svn.wordpress.org/trunk@40571


git-svn-id: http://core.svn.wordpress.org/trunk@40441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-05 18:49:47 +00:00
Andrea Fercia 3dab32af54 Accessibility: Improve the color contrast ratio of the dismiss notice buttons.
Props chris_dev.
Fixes #39970.

Built from https://develop.svn.wordpress.org/trunk@40570


git-svn-id: http://core.svn.wordpress.org/trunk@40440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-04 22:32:46 +00:00
Andrea Fercia 3c7698808f Customize: Fix a visual glitch on the widget control animation introduced in [40480].
Also, restores the original design intent that was meant to "compact widget-tops
on smaller laptops, but not tablets".

See #27112.
Fixes #31476.

Built from https://develop.svn.wordpress.org/trunk@40569


git-svn-id: http://core.svn.wordpress.org/trunk@40439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-03 22:39:44 +00:00
Andrea Fercia 1ca3b70929 Accessibility: Avoid a keyboard trap on the date and time custom format settings.
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
2017-05-02 20:03:42 +00:00
Weston Ruter 91a8af0ef6 Customize: Allow `select` dropdowns to stretch full width in widened controls pane.
Props timmydcrawford.
Amends [40511].
Fixes #32296.

Built from https://develop.svn.wordpress.org/trunk@40567


git-svn-id: http://core.svn.wordpress.org/trunk@40435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-02 19:30:46 +00:00
Sergey Biryukov 4995062686 Menus: Introduce `page_menu_link_attributes` filter in `Walker_Page::start_el()` for the HTML attributes applied to a page menu item's anchor element.
This complements the `nav_menu_link_attributes` filter used in `Walker_Nav_Menu::start_el()`.

Props pbiron.
Fixes #40359.
Built from https://develop.svn.wordpress.org/trunk@40565


git-svn-id: http://core.svn.wordpress.org/trunk@40434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 23:32:42 +00:00
John Blackbourn 42845bcb2d Build/Test Tools: Automatically skip tests in the `ms-required` and `ms-excluded` groups.
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
2017-05-01 20:35:44 +00:00
John Blackbourn 282408b6c0 Users: Add two missing special cases to the capability tests for non-logged-in users.
Also updates a `expectedIncorrectUsage` notation.

See #37405

Built from https://develop.svn.wordpress.org/trunk@40563


git-svn-id: http://core.svn.wordpress.org/trunk@40432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 16:19:44 +00:00
John Blackbourn d24f1f5864 Build/Test Tools: Pin the WordPress Importer plugin to version 0.6.3 when testing on Travis.
Fixes #40620

Built from https://develop.svn.wordpress.org/trunk@40562


git-svn-id: http://core.svn.wordpress.org/trunk@40431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 11:30:43 +00:00
John Blackbourn d1647d0b8c Build/Test Tools: Add object-cache.php to the unit test suite.
This removes an unnecessary external dependency from the Travis tests.

Fixes #40619

Built from https://develop.svn.wordpress.org/trunk@40561


git-svn-id: http://core.svn.wordpress.org/trunk@40430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-01 11:21:44 +00:00
John Blackbourn eb4db0e19c Users: Ensure user counts remain accurate if users are added to or removed from the `users` table without corresponding `usermeta` entries being added or removed.
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
2017-04-30 13:03:41 +00:00
John Blackbourn 224b88ca42 Posts, Post Types: Revert [40558] pending investigation.
See #18375

Built from https://develop.svn.wordpress.org/trunk@40559


git-svn-id: http://core.svn.wordpress.org/trunk@40428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-30 11:19:45 +00:00
John Blackbourn 53acb5b6d4 Posts, Post Types: Correct the attachment post type template unit test introduced in [38951].
Also adds additional assertions for the templates.

See #18375

Built from https://develop.svn.wordpress.org/trunk@40558


git-svn-id: http://core.svn.wordpress.org/trunk@40427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-29 21:16:45 +00:00
Boone Gorges fb0a08c8be Fix broken `check_comment()` test.
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
2017-04-27 16:23:47 +00:00
Andrea Fercia f1be128cde Widgets: Improve the News dashboard widget no-js notice.
In the rare case this notice was displayed, it was unstyled. Uses the notice 
error style to make it prettier and consistent with other no-js notices.
Also, some CSS clean-up.

Fixes #40529.

Built from https://develop.svn.wordpress.org/trunk@40556


git-svn-id: http://core.svn.wordpress.org/trunk@40425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-25 16:42:44 +00:00
John Blackbourn d3c74e8ce9 Feeds: Remove an incorrect usage of `sizeof()` in a helper class used during unit testing of XML element handling.
This also helps tidy up the test output when running PHP 7.2.

See #40109

Built from https://develop.svn.wordpress.org/trunk@40555


git-svn-id: http://core.svn.wordpress.org/trunk@40424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-24 01:23:43 +00:00
John Blackbourn 89b358082e Build/Test Tools: Remove HHVM from the test infrastructure on Travis.
Fixes #40548

Built from https://develop.svn.wordpress.org/trunk@40546


git-svn-id: http://core.svn.wordpress.org/trunk@40422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-24 00:28:44 +00:00
John Blackbourn 79ca3ca178 REST API: Remove a useless unit test.
See #35907, #38373

Built from https://develop.svn.wordpress.org/trunk@40545


git-svn-id: http://core.svn.wordpress.org/trunk@40421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 22:20:41 +00:00
John Blackbourn 37aed623c0 Build/Test Tools: Remove more unnecessary test skipping when erroneous situations occur.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40544


git-svn-id: http://core.svn.wordpress.org/trunk@40420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 22:12:42 +00:00
John Blackbourn 1ad93e1db9 Build/Test Tools: Introduce `skipWithoutMultisite()` and `skipWithMultisite`() methods into the test suite.
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
2017-04-23 21:58:41 +00:00
John Blackbourn 29b3932430 Build/Test Tools: More tweaks to the deprecated calls assertion. This needs to be triggered when there are unexpected deprecated calls or wrongdoings too.
See #40538

Built from https://develop.svn.wordpress.org/trunk@40542


git-svn-id: http://core.svn.wordpress.org/trunk@40418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 21:35:41 +00:00
John Blackbourn 0ec1f5aadf Build/Test Tools: Only perform an assertion for deprecated calls and wrongdoings if any are expected.
This avoids masking risky tests that don't otherwise perform an assertion.

See #40538

Built from https://develop.svn.wordpress.org/trunk@40541


git-svn-id: http://core.svn.wordpress.org/trunk@40417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 21:29:43 +00:00
Sergey Biryukov 2e6e53d26f Help/About: Fix typo in help text on Reading Settings screen.
Props Arena94, bhargavbhandari90.
Fixes #40530.
Built from https://develop.svn.wordpress.org/trunk@40540


git-svn-id: http://core.svn.wordpress.org/trunk@40416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 14:34:42 +00:00
John Blackbourn 975d00bd54 Build/Test Tools: Move the `setExpectedException()` method into the `WP_Ajax_UnitTestCase` class to avoid a fatal error when PHPUnit 3.6 is in use.
This needs more investigation but it gets the test suite on PHP 5.2 passing again.

See #39822

Built from https://develop.svn.wordpress.org/trunk@40539


git-svn-id: http://core.svn.wordpress.org/trunk@40415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 11:46:42 +00:00
John Blackbourn 36c977b9b1 Build/Test Tools: Add Composer files to the cache on Travis.
The Travis cache is specific to the branch and language version (PHP version), so this should speed up each subsequent build once the cache is primed.

Props netweb

Fixes #40539

Built from https://develop.svn.wordpress.org/trunk@40538


git-svn-id: http://core.svn.wordpress.org/trunk@40414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 11:40:43 +00:00
Peter Wilson 717de16c68 Menus: Add filter to sub-menu class in nav menus.
Add new filter `nav_menu_submenu_css_class` to the `Walker_Nav_Menu::start_el()` method, allowing themers to modify the sub menu classes output by `wp_nav_menu()`.

Props: csloisel, darthaud, raisonon.
Fixes: #36163.

Built from https://develop.svn.wordpress.org/trunk@40537


git-svn-id: http://core.svn.wordpress.org/trunk@40413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 07:16:43 +00:00
John Blackbourn 812ac18853 Build/Test Tools: Add support for PHPUnit 6+.
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
2017-04-23 02:06:40 +00:00
John Blackbourn 6bcec554c3 Build/Test Tools: Ensure that `WP_UnitTestCase::expectedDeprecated()` performs an assertion to avoid risky test notices.
See #40538

Built from https://develop.svn.wordpress.org/trunk@40535


git-svn-id: http://core.svn.wordpress.org/trunk@40411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 01:45:43 +00:00
John Blackbourn 3b24784333 Build/Test Tools: Be strict about tests that do not test anything.
See #40538

Built from https://develop.svn.wordpress.org/trunk@40534


git-svn-id: http://core.svn.wordpress.org/trunk@40410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-23 01:25:42 +00:00
John Blackbourn 6e4b6591d8 Build/Test Tools: Remove unnecessary checks and skips that should instead cause failures if they ever fail.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40533


git-svn-id: http://core.svn.wordpress.org/trunk@40409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 22:55:40 +00:00
John Blackbourn fe06ac7e39 Build/Test Tools: Convert more test skipping into hard failures. These dependencies should all be present when testing.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40532


git-svn-id: http://core.svn.wordpress.org/trunk@40408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 22:12:41 +00:00
John Blackbourn f1fff0b06e Build/Test Tools: Convert more test skipping into hard failures. These dependencies should all be present when testing.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40531


git-svn-id: http://core.svn.wordpress.org/trunk@40407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 22:01:42 +00:00
John Blackbourn af587d874d Build/Test Tools: Correct an incorrect `ms-` group name.
See #40531

Built from https://develop.svn.wordpress.org/trunk@40530


git-svn-id: http://core.svn.wordpress.org/trunk@40406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 21:44:42 +00:00
John Blackbourn e76e3d459a Build/Test Tools: Partially revert [40524].
See #40533, #40535

Built from https://develop.svn.wordpress.org/trunk@40529


git-svn-id: http://core.svn.wordpress.org/trunk@40405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 21:22:43 +00:00
John Blackbourn 69bb8fa5c9 Build/Test Tools: Add some locale debugging to the Travis config so we can determine which locales are available to test with.
See #40533, #19861

Built from https://develop.svn.wordpress.org/trunk@40528


git-svn-id: http://core.svn.wordpress.org/trunk@40404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 21:01:42 +00:00
John Blackbourn ba88762aa3 Build/Test Tools: Enable verbose mode in PHPUnit so we can see which tests are being skipped, and now that the number of skipped tests has been lowered.
See #40533, #40531

Built from https://develop.svn.wordpress.org/trunk@40527


git-svn-id: http://core.svn.wordpress.org/trunk@40403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 20:25:39 +00:00
John Blackbourn 7696954d91 Build/Test Tools: Don't trigger a skipped test when the built version of `wp-embed.min.js` isn't present.
The grunt command assertion prior to the check for the existence of the file is enough to safeguard this test.

See #34698, #40533

Built from https://develop.svn.wordpress.org/trunk@40526


git-svn-id: http://core.svn.wordpress.org/trunk@40402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 20:18:42 +00:00
John Blackbourn 0371277d5a Build/Test Tools: Replace test skipping with actual assertions when dealing with the `DISALLOW_UNFILTERED_HTML`, `DISALLOW_FILE_MODS`, and `DISALLOW_FILE_EDIT` constants.
If any of these constants are set during testing, they should cause the tests to fail, not to be skipped, otherwise we have a situation where failure conditions are never seen.

See #40533

Built from https://develop.svn.wordpress.org/trunk@40525


git-svn-id: http://core.svn.wordpress.org/trunk@40401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 20:13:42 +00:00
John Blackbourn 1cbc2c3857 Build/Test Tools: Remove more skipped tests that should actually be failures if their conditions aren't satisfied.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40524


git-svn-id: http://core.svn.wordpress.org/trunk@40400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:43:41 +00:00
John Blackbourn a0e67d3e16 Build/Test Tools: Remove ancient UT ticket handling.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40523


git-svn-id: http://core.svn.wordpress.org/trunk@40399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:39:43 +00:00
John Blackbourn f12c419ee3 Build/Test Tools: Add some more tests to the `ms-required` and `ms-excluded` groups.
See #40531

Built from https://develop.svn.wordpress.org/trunk@40522


git-svn-id: http://core.svn.wordpress.org/trunk@40398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:22:44 +00:00
John Blackbourn af6c8d1bc6 Build/Test Tools: Remove a useless test.
See #33898, #40533

Built from https://develop.svn.wordpress.org/trunk@40521


git-svn-id: http://core.svn.wordpress.org/trunk@40397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 19:10:43 +00:00
John Blackbourn 17b73338f1 Build/Test Tools: Introduce `ms-required` and `ms-excluded` groups for tests.
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
2017-04-22 18:59:41 +00:00
John Blackbourn ed1d714572 Build/Test Tools: Don't skip tests when php.net or dev.mysql.com are unreachable.
This sort of behaviour subtly hides the fact that these tests will never fail if the URLs where version number information is fetched from go away for one reason or another.

See #40533

Built from https://develop.svn.wordpress.org/trunk@40519


git-svn-id: http://core.svn.wordpress.org/trunk@40395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 18:45:40 +00:00
John Blackbourn aa8f871f21 Build/Test Tools: Avoid skipping canonical tests that are connected to open Trac tickets.
This is a remnant of the test suite behaviour before #30284 fixed most of it and makes it far too easy to hide failing tests.

If any tests begin to fail as a result of this change then they should be fixed.

Fixes #40534

Built from https://develop.svn.wordpress.org/trunk@40518


git-svn-id: http://core.svn.wordpress.org/trunk@40394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 18:26:42 +00:00
John Blackbourn dd0346b330 Canonical: Don't skip tests if the test data is invalid.
See #40533

Built from https://develop.svn.wordpress.org/trunk@40517


git-svn-id: http://core.svn.wordpress.org/trunk@40393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 17:30:44 +00:00
John Blackbourn 8d3d439684 Posts, Post Types: Correct the fallback value for the `label_count` argument of `register_post_status()`.
While using `_n_noop()` here is technically incorrect, it does correct the fallback value as its usage in `translate_nooped_plural()` expects a correctly formatted associative array.

Props xrmx

Fixes #38686

Built from https://develop.svn.wordpress.org/trunk@40516


git-svn-id: http://core.svn.wordpress.org/trunk@40392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 14:17:42 +00:00
Andrew Ozz c7058c739d Editor: fix undefined var notice in editor_js() in class-wp-editor.php.
Props littler.chicken.
Fixes #40501, see #35760.
Built from https://develop.svn.wordpress.org/trunk@40515


git-svn-id: http://core.svn.wordpress.org/trunk@40391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-22 01:12:44 +00:00
Boone Gorges e45ee36b84 Restore support for taxonomy 'args' override when querying object terms.
[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
2017-04-21 19:14:44 +00:00
Weston Ruter cc77899e7f Customize: Increase width of controls pane on large monitors to give more room.
Props celloexpressions, timmydcrawford.
Fixes #32296.

Built from https://develop.svn.wordpress.org/trunk@40511


git-svn-id: http://core.svn.wordpress.org/trunk@40387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-21 05:25:43 +00:00
Weston Ruter 9eb9cc40bd Customize: Fix visibility of "Hide Controls" link in IE.
Amends [39214].
Props timmydcrawford.
See #32296, #38762.
Fixes #40507.

Built from https://develop.svn.wordpress.org/trunk@40510


git-svn-id: http://core.svn.wordpress.org/trunk@40386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-21 05:16:45 +00:00
Felix Arntz 9c8bf59842 Multisite: Add `$network_id` parameter to `wp_update_network_counts()`.
After the `$network_id` parameter has been introduced for `wp_update_network_site_counts()` in [40484] and `wp_update_network_user_counts()` in [40485], the new parameter can now also be used on the wrapping function.

Fixes #40386. See #38699.

Built from https://develop.svn.wordpress.org/trunk@40486


git-svn-id: http://core.svn.wordpress.org/trunk@40362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-20 00:27:42 +00:00
Felix Arntz 79be8dff6d Multisite: Add `$network_id` parameter to `wp_update_network_user_counts()`.
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
2017-04-20 00:14:43 +00:00
Felix Arntz 7fa610b34a Multisite: Add `$network_id` parameter to `wp_update_network_site_counts()`.
Using the new parameter, it is now possible to update the site counts on a network different from the current network.

Props PieWP, johnjamesjacoby.
Fixes #37528. See #38699.

Built from https://develop.svn.wordpress.org/trunk@40484


git-svn-id: http://core.svn.wordpress.org/trunk@40360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-20 00:00:42 +00:00
Sergey Biryukov 35987df4e4 Docs: Improve `@param` and `@return` entries for `wp_get_post_categories()`, `wp_get_post_tags()`, and `wp_get_post_terms()`.
Props philipjohn, theMikeD.
Fixes #40481.
Built from https://develop.svn.wordpress.org/trunk@40483


git-svn-id: http://core.svn.wordpress.org/trunk@40359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 23:08:40 +00:00
Andrew Ozz c0399b4fde TinyMCE: Fix cursor position after updating a wpview node. Fix hiding the inline toolbar on editor blur.
Props iseulde, azaozz.
Fixes #40480 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40481


git-svn-id: http://core.svn.wordpress.org/trunk@40357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 22:10:42 +00:00
Andrea Fercia 1d739a0925 Accessibility: Make some Widgets buttons real buttons.
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 #35622

Fixes #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
2017-04-19 21:14:44 +00:00
Andrea Fercia 711796d172 Accessibility: Make Safari 10 + VoiceOver announce repeated, identical, `wp.a11y.speak()` messages.
Safari 10 + VoiceOver don't announce repeated, identical, strings sent to an 
`aria-live` region. Appending a `no-break space` to a repeated message string,
forces them to think the strings are different.

Fixes #36853.

Built from https://develop.svn.wordpress.org/trunk@40479


git-svn-id: http://core.svn.wordpress.org/trunk@40355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 19:53:42 +00:00
Dominik Schilling 7977451301 Multisite: After [37918] add support for retrieving custom site properties set by the `site_details` filter.
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
2017-04-19 18:52:44 +00:00
Sergey Biryukov ebf0b9e46e Editor: Define `$suffix` before using it in `_WP_Editors::print_tinymce_scripts()`.
Props imath.
Fixes #40479. See #35760.
Built from https://develop.svn.wordpress.org/trunk@40477


git-svn-id: http://core.svn.wordpress.org/trunk@40353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 12:02:46 +00:00
Andrew Ozz d0e4448257 Editor: Provide API for the editor to be dynamically instantiated via JS. First run.
See: #35760
Built from https://develop.svn.wordpress.org/trunk@40476


git-svn-id: http://core.svn.wordpress.org/trunk@40352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-19 02:38:44 +00:00
Pascal Birchler c58cb3af9e Twenty Seventeen: Bump version and update the changelog.
Updates changelog to link to Codex pages, like other default themes.

Props swissspidy, davidakennedy.
Fixes #40461.

Built from https://develop.svn.wordpress.org/trunk@40472


git-svn-id: http://core.svn.wordpress.org/trunk@40348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-18 09:14:46 +00:00
Weston Ruter cb6086ae9b Customize: Use fixed-width illustrative placeholder for hex field in color picker to prevent truncation.
Props stormrockwell, sagarprajapati, Presskopp, afercia, tejas5989, westonruter, mayurk for testing.
Fixes #39096.

Built from https://develop.svn.wordpress.org/trunk@40471


git-svn-id: http://core.svn.wordpress.org/trunk@40347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-18 00:31:43 +00:00
Pascal Birchler e5c05e18a1 Twenty Seventeen: Correct heading hierarchy for posts on the front page.
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
2017-04-17 10:09:43 +00:00
John Blackbourn c2d7701a31 Build/Test tools: Reverse the order in which the Travis jobs run.
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
2017-04-15 17:43:41 +00:00
John Blackbourn 1e9446310a Networks and Sites: Correct a capability check when accessing the Sites -> Add New screen.
Props flixos90

See #39156

Built from https://develop.svn.wordpress.org/trunk@40433


git-svn-id: http://core.svn.wordpress.org/trunk@40331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-15 17:30:48 +00:00
Sergey Biryukov 7ee5878a9c Docs: Update the length limit in `set_site_transient()` docs after [34030].
Props lukecavanagh, jdgrimes.
Fixes #40455.
Built from https://develop.svn.wordpress.org/trunk@40432


git-svn-id: http://core.svn.wordpress.org/trunk@40330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-15 09:28:43 +00:00
Adam Silverstein 9ff1301ae5 Upload: improve legacy SWFUpload event handlers for current jQuery.
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
2017-04-14 16:43:44 +00:00
James Nylen 999c807b88 Media: Default to always showing the "Create Audio/Video Playlist" buttons.
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
2017-04-14 11:25:43 +00:00
Pascal Birchler 38c4565187 Media: Ensure Crop Image is always visible.
Previously, the crop button in the media modal after uploading header images or similar was hidden and the task could not be completed.

Props karinedo, sagarprajapati, Cybr, mayurk.
Fixes #40152.

Built from https://develop.svn.wordpress.org/trunk@40428


git-svn-id: http://core.svn.wordpress.org/trunk@40326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 09:31:43 +00:00
Sergey Biryukov 9fb2e79b57 Posts, Post Types: In `wp_check_post_lock()`, check if the user with lock exists and return false otherwise.
Props arshidkv12, 1naveengiri.
Fixes #39888.
Built from https://develop.svn.wordpress.org/trunk@40424


git-svn-id: http://core.svn.wordpress.org/trunk@40322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 23:09:43 +00:00
Sergey Biryukov bef3ff1377 Posts, Post Types: Improve the docs for `wp_check_post_lock()` and `wp_set_post_lock()`.
See #39888.
Built from https://develop.svn.wordpress.org/trunk@40423


git-svn-id: http://core.svn.wordpress.org/trunk@40321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 23:02:42 +00:00
Sergey Biryukov 902b91400d Administration: Add "(link opens in a new window)" as a screen reader text for "Preview" link on Edit Post screen.
Props rianrietveld.
Fixes #40185.
Built from https://develop.svn.wordpress.org/trunk@40422


git-svn-id: http://core.svn.wordpress.org/trunk@40320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 22:42:43 +00:00
James Nylen 7d8451ff70 Media: Improve filters that allow overriding slow media queries.
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
2017-04-13 20:22:44 +00:00
Andrea Fercia 5599164cb7 Toolbar: Reset CSS properties that might be inherited from the active Theme.
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
2017-04-12 16:12:43 +00:00
John Blackbourn c26a9a4478 Build/Test tools: Introduce and implement `assertNotIXRError()` and `assertIXRError()` assertion methods.
This aids in debugging XMLRPC tests which fail, by exposing the `IXR_Error` error message in the assertion failure message.

Fixes #40423

Built from https://develop.svn.wordpress.org/trunk@40417


git-svn-id: http://core.svn.wordpress.org/trunk@40315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-12 14:59:44 +00:00
John Blackbourn 927bd9aeb8 Build/Test tools: Improve the failure message reported by `assertQueryTrue()` so it's a little less cryptic.
Fixes #40411

Built from https://develop.svn.wordpress.org/trunk@40416


git-svn-id: http://core.svn.wordpress.org/trunk@40314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-11 10:48:43 +00:00
Felix Arntz 45b64ba2ff Multisite: Replace unnecessary `is_super_admin()` check when setting up the initial network.
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
2017-04-10 22:00:43 +00:00
Weston Ruter 226e34effc Customize: Verify availability of `history.replaceState` (in IE9) before attempting to populate `changeset_uuid` parameter.
Props westonruter, timmydcrawford for testing.
Amends [39686].
See #39227.
Fixes #40405.

Built from https://develop.svn.wordpress.org/trunk@40405


git-svn-id: http://core.svn.wordpress.org/trunk@40312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 21:15:41 +00:00
Felix Arntz 9354ea683f Multisite: Introduce an `upgrade_network` capability.
Prior to this change, a mix of `is_super_admin()` calls and `manage_network` capability checks was used to determine whether the current user could upgrade the network. With this changeset a dedicated capability is introduced that allows more granular handling.

Props dhanendran for the original patch.
Fixes #39205. See #37616.

Built from https://develop.svn.wordpress.org/trunk@40404


git-svn-id: http://core.svn.wordpress.org/trunk@40311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 21:11:43 +00:00
Joe McGill 4e1f22bf78 Fix broken audio/video functions when sanitizing ID3 data
This fixes a bug where running `wp_kses_post_deep()` on all the ID3
tag data corrupted blob data.

Fixes #40075, #40085.

Built from https://develop.svn.wordpress.org/trunk@40400


git-svn-id: http://core.svn.wordpress.org/trunk@40307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 01:28:47 +00:00
Andrew Ozz eab25ea270 TinyMCE: update the tests for version 4.5.6. Remove default plugins tests, it is quite pointless to keep repeating them at this point.
See #40305.

Built from https://develop.svn.wordpress.org/trunk@40399


git-svn-id: http://core.svn.wordpress.org/trunk@40306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 23:11:42 +00:00
Andrew Ozz 23850c3952 Update TinyMCE to 4.5.6. Has many improvements and bug fixes. Changelog: https://github.com/tinymce/tinymce/blob/4.5.x/changelog.txt.
Fixes #40305 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40398


git-svn-id: http://core.svn.wordpress.org/trunk@40305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 23:01:43 +00:00
Joe McGill efab6e06ca Media: Improve handling of non-image files in wp_get_image_mime.
This prevents non-image fileypes from returning a mime type of
"application/octet-stream" when `exif_imagetype()` returns `false`.

Props blobfolio.
Fixes #40017.

Built from https://develop.svn.wordpress.org/trunk@40397


git-svn-id: http://core.svn.wordpress.org/trunk@40304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-09 22:44:43 +00:00
Weston Ruter 57b386ef1e Customize: Fix behavior of clicking Delete Menu link and keep available nav menu items panel open when doing bulk deletion.
Props maguiar, adamsilverstein for testing.
Amends [39548].
Fixes #38953.

Built from https://develop.svn.wordpress.org/trunk@40396


git-svn-id: http://core.svn.wordpress.org/trunk@40303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 20:22:43 +00:00
Weston Ruter ad293eade7 Customize: Auto-expand a widget area section when expanding the Widgets panel if there is only one registered sidebar and it is active.
Introduces `WP_Customize_Panel::$auto_expand_sole_section` property which allows panels to opt-in to the behavior, which the Widgets panel is made to do by default.

Props delawski, westonruter, melchoyce.
Fixes #37471.

Built from https://develop.svn.wordpress.org/trunk@40395


git-svn-id: http://core.svn.wordpress.org/trunk@40302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 19:27:40 +00:00
Pascal Birchler 8473f9ef66 Upgrade/Install: Introduce `wp_disallow_file_mods()` helper function.
This is a wrapper around the checks for the `DISALLOW_FILE_MODS` constant to determine whether file modifications are disallowed.

Props MaximeCulea.
Fixes #38673.

Built from https://develop.svn.wordpress.org/trunk@40394


git-svn-id: http://core.svn.wordpress.org/trunk@40301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 14:36:50 +00:00
John Blackbourn 0c2338fab2 Networks and Sites: Align the display of site statuses on the Sites listing screen with those of posts on the Posts listing screen.
Fixes #40290

Built from https://develop.svn.wordpress.org/trunk@40393


git-svn-id: http://core.svn.wordpress.org/trunk@40300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 13:51:43 +00:00
John Blackbourn 6ba598cc34 Build/Test tools: Remove occurrences of `create_function()` in unit tests.
Props desrosj

See #37082

Built from https://develop.svn.wordpress.org/trunk@40392


git-svn-id: http://core.svn.wordpress.org/trunk@40299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 13:38:41 +00:00
Felix Arntz ce6153d52a Multisite: Partially revert [40295].
[40295] removed the restriction of a minimum amount of characters for new site names, which could cause unexpected behavior. That changeset is reverted here with the exception of the removal of the `is_super_admin()` check, which can safely be omitted. A new filter for the minimum site name length will be introduced later to be able to modify that behavior.

See #39676, #37616.

Built from https://develop.svn.wordpress.org/trunk@40391


git-svn-id: http://core.svn.wordpress.org/trunk@40298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 13:15:42 +00:00
Felix Arntz 00e8704288 Multisite: Introduce a `setup_network` capability for setting up multisite.
`setup_network` is a new meta capability that brings more granular control over the permissions to setup a multisite environment. In a non-multisite environment it falls back to `manage_options` while in a multisite it falls back to `manage_network_options`. The introduction of this capability furthermore allows replacing an `is_super_admin()` check.

Props ashokkumar24 for the original patch.
Fixes #39206. See #37616.

Built from https://develop.svn.wordpress.org/trunk@40390


git-svn-id: http://core.svn.wordpress.org/trunk@40297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-07 12:53:45 +00:00
Pascal Birchler 72c19648bc Load: Only load `PasswordHash` class when needed.
This reverts [38371] which loaded `class-phpass.php` early in `wp-settings.php` and in turn caused backward compatibility problems.

Props DavidAnderson, ketuchetan.
Fixes #39445.

Built from https://develop.svn.wordpress.org/trunk@40387


git-svn-id: http://core.svn.wordpress.org/trunk@40294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 18:01:42 +00:00
James Nylen 5584f22d53 Media: Add filters to allow overriding slow media queries.
There are a couple of queries that do a full table scan of attachment posts to support features of the media library.  Pending a more complete solution, allow overriding these queries via filters.

Props sboisvert, jnylen0.
See #31071.

Built from https://develop.svn.wordpress.org/trunk@40382


git-svn-id: http://core.svn.wordpress.org/trunk@40289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 03:57:45 +00:00
Weston Ruter 19d960e257 Customize: Fix HTTPS navigation of site in preview on IE11.
Accounts for HTTPS links (port 443) where [40318] only accounted for HTTP links (port 80). Addresses issue in IE11 where the default port number is unexpectedly included on `link.host` for links dynamically created by scripts.

Props mattwiebe.
Amends [40318], [38890].
See #38409.
Fixes #40198.

Built from https://develop.svn.wordpress.org/trunk@40381


git-svn-id: http://core.svn.wordpress.org/trunk@40288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 00:32:44 +00:00
Weston Ruter 162785c65f Customize: Fix reversal of nav menu item's `type` and `object` properties for page stub added in customizer.
Amends [38906].
See #38164.
Fixes #40277.

Built from https://develop.svn.wordpress.org/trunk@40380


git-svn-id: http://core.svn.wordpress.org/trunk@40287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 23:29:42 +00:00
Weston Ruter 5f771393a3 Customize: Use `is_header_video_active()` as `active_callback` for `external_header_video` control instead of `is_front_page()`.
Use the same `active_callback` as was supplied previously for the `header_video` control in [39240] where this instance was missed.

Amends [39240].
Props pratikshrestha.
See #38738.
Fixes #40308.

Built from https://develop.svn.wordpress.org/trunk@40379


git-svn-id: http://core.svn.wordpress.org/trunk@40286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 23:10:42 +00:00
James Nylen 99b13790c2 REST API: Allow fetching multiple users at once via the `slug` parameter.
This matches similar changes previously made for posts (#38579) and terms (#40027).

Props curdin, MatheusGimenez.
Fixes #40213.

Built from https://develop.svn.wordpress.org/trunk@40378


git-svn-id: http://core.svn.wordpress.org/trunk@40285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 22:25:43 +00:00
James Nylen 1979815aef REST API: Update description string of terms endpoint `slug` parameter.
As a follow-up to [40376], and for consistency with the posts endpoint, we should indicate in the description that the `slug` filter parameter can accept multiple values.

See #40027.

Built from https://develop.svn.wordpress.org/trunk@40377


git-svn-id: http://core.svn.wordpress.org/trunk@40284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 21:08:43 +00:00
James Nylen 9f2d94b211 REST API: Allow fetching multiple terms at once via the `slug` parameter.
This matches a similar change previously made for posts (#38579) and an upcoming change for users (#40213).

Props wonderboymusic, MatheusGimenez, curdin.
Fixes #40027.

Built from https://develop.svn.wordpress.org/trunk@40376


git-svn-id: http://core.svn.wordpress.org/trunk@40283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 20:25:46 +00:00