Commit Graph

36607 Commits

Author SHA1 Message Date
Dominik Schilling (ocean90) 0202bed74d Import: Replace `assert()` calls with PHPUnit's `assertTrue()` method.
Calling `assert()` with a string argument will be deprecated in PHP 7.2.

See #40109.

git-svn-id: https://develop.svn.wordpress.org/trunk@40649 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-12 07:37:33 +00:00
Andrea Fercia 2156223d50 Add missing semicolons after [40646].
See #40453.


git-svn-id: https://develop.svn.wordpress.org/trunk@40648 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-12 07:04:07 +00:00
Andrea Fercia ead4097f11 Media: Clean-up some MediaElementJS CSS: no more needed after [40642].
See #40707, #32417, #39994, #39995, #30281.


git-svn-id: https://develop.svn.wordpress.org/trunk@40647 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-12 06:59:53 +00:00
Andrea Fercia aef3839e7b Accessibility: Change the "Show details" links in the update core screen to buttons.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40646 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 23:50:01 +00:00
Andrew Ozz 1705f4501e TinyMCE: update to 4.6.1. Changelog: https://www.tinymce.com/docs/changelog/#version461-may102017
Fixes #40727.

git-svn-id: https://develop.svn.wordpress.org/trunk@40645 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 23:11:46 +00:00
Andrew Ozz c098bc38d0 TinyMCE: prevent removing of the temp link element when opening the advanced link dialog to insert new link.
Part props figureone for finding the cause.
Fixes #40558.

git-svn-id: https://develop.svn.wordpress.org/trunk@40644 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 23:03:17 +00:00
Andrea Fercia bf4b384fd4 Accessibility: Add "(opens in a new window)" screen reader text to the "News-Nearby Events" dashboard widget footer links.
- standardizes similar messages in core to always use `(opens in a new window)`
- adds translators comments
- hides the dashicons with `aria-hidden="true"`, see #40428

Fixes #40733.


git-svn-id: https://develop.svn.wordpress.org/trunk@40643 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 22:46:59 +00:00
Andrea Fercia e59c9d3567 Media: Remove the custom styling for the MediaElementJS controls offscreen text.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40642 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 22:28:40 +00:00
Weston Ruter 42487a5b23 Widgets: Utilize WP REST API oEmbed proxy endpoint in media widgets.
Props timmydcrawford.
See #32417, #40450.


git-svn-id: https://develop.svn.wordpress.org/trunk@40641 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 21:23:50 +00:00
Weston Ruter da32c2f630 Widgets: Introduce media widgets for images, audio, and video with extensible base for additional media widgets in the future.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40640 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 21:10:54 +00:00
Pascal Birchler 51f545e72a Upgrade/Install: After [40638], make sure `wp_is_file_mod_allowed()` actually returns the right value.
See #38673.



git-svn-id: https://develop.svn.wordpress.org/trunk@40639 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:53:38 +00:00
Pascal Birchler 3f059bff7c Upgrade/Install: After [40394], rename `wp_disallow_file_mods()` to `wp_is_file_mod_allowed()`.
This makes it more clear what this function is about.

Props Mte90.
Fixes #38673.


git-svn-id: https://develop.svn.wordpress.org/trunk@40638 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:23:45 +00:00
Dominik Schilling (ocean90) d880e60f11 KSES: Support `'tag' => true` as a shorthand for `'tag' => array()` in `wp_kses_attr()`.
`Automatic_Upgrader_Skin::feedback()` had always assumed that this is already the case, now it is.

See #20017.
Fixes #40680.

git-svn-id: https://develop.svn.wordpress.org/trunk@40637 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:22:17 +00:00
Pascal Birchler 64f2a546f0 Themes: Avoid PHP warnings in the admin when no theme directory exists.
Props iseulde, chris_dev, swissspidy.
Fixes #35521.


git-svn-id: https://develop.svn.wordpress.org/trunk@40636 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:20:10 +00:00
Pascal Birchler ec6de050b7 Posts, Post Types: Add initial tests for `get_post_type_labels()`.
See #38218.
Fixes #38157.


git-svn-id: https://develop.svn.wordpress.org/trunk@40635 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:18:53 +00:00
Pascal Birchler d8ca95415e Administration: Ensure `validateForm` also validates other input fields.
With this change, textareas and select inputs will be checked as well.

Props shadyvb.
Fixes #37540.


git-svn-id: https://develop.svn.wordpress.org/trunk@40634 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:17:11 +00:00
Dominik Schilling (ocean90) 2dbc6ea67b Plugins: Don't strip line breaks and blockquote elements in the plugin information modal.
Fixes #40679.

git-svn-id: https://develop.svn.wordpress.org/trunk@40633 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:15:30 +00:00
Pascal Birchler a619778c3b Mail: Ensure entities are decoded in email change notifications on Multisite.
Adds new tests to ensure this bug does not pop up again.

Props stephenharris.
Fixes #40015.


git-svn-id: https://develop.svn.wordpress.org/trunk@40632 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 19:14:55 +00:00
Weston Ruter 5eb62b94ad Widgets: Extend the Text widget with TinyMCE.
Introduces rich text formatting: bold, italic, lists, links.

Props westonruter, azaozz, timmydcrawford, obenland, melchoyce.
See #35760.
Fixes #35243.


git-svn-id: https://develop.svn.wordpress.org/trunk@40631 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 18:54:24 +00:00
James Nylen 946bcc9c95 REST API: Update `wp-api.js` fixtures after string changes.
See #39178.


git-svn-id: https://develop.svn.wordpress.org/trunk@40630 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 18:40:17 +00:00
James Nylen 8f0fa8c0d6 REST API: Tests: Remove and prohibit errors when generating `wp-api.js` fixtures.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@40629 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 18:31:26 +00:00
James Nylen d59f437268 REST API: Add endpoint for proxying requests to external oEmbed providers.
This endpoint is a prerequisite for the media widgets work (see https://github.com/xwp/wp-core-media-widgets).

Also use the new endpoint in the media modal instead of the `parse-embed` AJAX action.

Props westonruter, timmydcrawford, swissspidy, jnylen0.
Fixes #40450.


git-svn-id: https://develop.svn.wordpress.org/trunk@40628 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 18:18:00 +00:00
Weston Ruter 33622d9179 Customize: Wait for `processing` state to clear before starting to `captureSettingModifiedDuringSave`.
See #32941.
Fixes #40729.


git-svn-id: https://develop.svn.wordpress.org/trunk@40627 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 06:41:25 +00:00
Peter Wilson ed754069ca Emoji: Update Twemoji to version 2.2.5
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40626 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 04:25:22 +00:00
Andrew Ozz 0c63472b68 Editor: manually trigger `change` event when text is modified from JS.
Props westonruter.
Fixes #40726.

git-svn-id: https://develop.svn.wordpress.org/trunk@40615 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 00:28:43 +00:00
Gary Pendergast ab5cd5011f Build/Test: Revert that failing test.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@40614 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-11 00:15:05 +00:00
Gary Pendergast a301163c46 Build/Test: Add an intentionally failing test.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@40613 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 23:36:18 +00:00
Felix Arntz 9d2d5b536d Multisite: Adjust site count of the correct network after having created a new site.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40612 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 23:21:43 +00:00
Felix Arntz 883c0b04a9 Multisite: Fix usage of incorrect `site_count` network option name in unit tests.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40611 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 23:12:24 +00:00
Felix Arntz 1d1220d566 Multisite: Fix unstable unit test for `get_blog_count()`.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40610 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 23:02:42 +00:00
Peter Wilson 19f9a9ee2d Emoji: Clear canvas between flag tests.
Clear the canvas following the two flag tests following [40582].

Fixes #40616.



git-svn-id: https://develop.svn.wordpress.org/trunk@40609 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 22:43:47 +00:00
Weston Ruter 68320b3d9b Customize: Fix clearing of `fresh_site` option flag when editing sidebars on widgets admin screen.
Amends [38991].
See #38114, #38533.
Fixes #40722.


git-svn-id: https://develop.svn.wordpress.org/trunk@40608 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 21:24:29 +00:00
Andrew Ozz be2a26ab08 Dashboard: Update the existing WordPress News dashboard widget to also include upcoming meetup events and WordCamps near the current user’s location.
Props @afercia, @andreamiddleton, @azaozz, @camikaos, @coreymckrill, @chanthaboune, @courtneypk, @dd32, @iandunn, @iseulde, @mapk, @mayukojpn, @melchoyce, @nao, @obenland, @pento, @samuelsidler, @stephdau, @tellyworth.
See #40702.

git-svn-id: https://develop.svn.wordpress.org/trunk@40607 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 20:03:01 +00:00
James Nylen 8712f5dcb4 REST API: Improve a few more strings added after the 4.7 string freeze.
See #39178.

See also #40720 for potential follow-up steps.


git-svn-id: https://develop.svn.wordpress.org/trunk@40606 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 19:40:56 +00:00
James Nylen 0fab6c9fdc REST API: Add `author`, `modified`, and `parent` sort order options for posts.
These (and a few others that can be revisited later if needed) were present in
beta versions of the WP REST API but were removed during the merge to WP 4.7.

Props ChopinBach, jnylen0.
Fixes #38693.


git-svn-id: https://develop.svn.wordpress.org/trunk@40605 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 18:51:28 +00:00
Gary Pendergast 93ddc497f0 Build/Test: Post Travis results to Slack from `WordPress/wordpress-develop`
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@40604 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 10:28:19 +00:00
Ryan McCue f6b507f6a8 Options/Meta: Document valid types for registration.
In 4.7, the REST API introduced types for options and meta passed into the registration functions. This adds the documentation for those types.

Props iandunn, priyankabehera155.
Fixes #40318.


git-svn-id: https://develop.svn.wordpress.org/trunk@40603 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 06:09:36 +00:00
Ryan McCue faa6386ca0 REST API: Include featured_media in embed responses.
Props kadamwhite, jnylen0, westonruter.
Fixes #39805.


git-svn-id: https://develop.svn.wordpress.org/trunk@40602 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 04:45:10 +00:00
Ryan McCue 292a871e44 REST API: Set global $post when preparing revisions.
For compatibility with filters on hooks on content filters (such as shortcodes), we need to set the global. This mirrors the Posts controller.

Props pdufour, jnylen0.
Fixes #40626.


git-svn-id: https://develop.svn.wordpress.org/trunk@40601 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 04:31:28 +00:00
Ryan McCue 3f66cf5a2d REST API: Allow "Origin: null" from file: URLs.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40600 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 04:22:01 +00:00
Andrew Ozz 2e9582fd6d Editor: Update `wp.editor.remove()` to use the new Quicktags instance `removep()`.
Fixes: #35760

git-svn-id: https://develop.svn.wordpress.org/trunk@40599 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 02:49:40 +00:00
Andrew Ozz ef7b643a97 Editor: Add `init` and `remove` methods to Quicktags.
Props helgatheviking azaozz.
Fixes #26183 #40708.

git-svn-id: https://develop.svn.wordpress.org/trunk@40598 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-10 02:46:24 +00:00
Mike Schroder cee49addad Media: Optionally return attachment id from `media_sideload_image()`.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@40597 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 23:25:56 +00:00
Felix Arntz c449b34f6c Multisite: Fix filter hooks for the updating network count functions.
[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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40596 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 17:14:08 +00:00
Jeremy Felt 0dd638a2e7 Multisite: Check only valid looking emails against banned domain list.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40595 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:54:52 +00:00
Jeremy Felt 3e9c46812c Multisite: Validate email before checking against banned domains.
Previously, an invalid email could result in an undefined index when attempting to determine the email domain.

Props ocean90.
See #39915.


git-svn-id: https://develop.svn.wordpress.org/trunk@40594 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:32:53 +00:00
Felix Arntz 4678a2c00e Multisite: Add `$network_id` parameter to `wp_maybe_update_network_user_counts()`.
This allows calling the function for a specific network correctly, for example after a user has been created for it or been removed from it.

Fixes #40385. See #38699.


git-svn-id: https://develop.svn.wordpress.org/trunk@40593 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:07:46 +00:00
Felix Arntz a78b5259c6 Multisite: Add missing documentation for new `$network_id` parameter of `wp_maybe_update_network_site_counts()`.
This was overlooked in [40591].

See #40384.


git-svn-id: https://develop.svn.wordpress.org/trunk@40592 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 16:01:49 +00:00
Felix Arntz 28d82148db Multisite: Add `$network_id` parameter to `wp_maybe_update_network_site_counts()`.
This allows calling the function for a specific network correctly, for example after a site has been created for it or been removed from it.

Fixes #40384. See #38699.


git-svn-id: https://develop.svn.wordpress.org/trunk@40591 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 15:59:39 +00:00
Felix Arntz 1515787d31 Multisite: Add `$network_id` parameter to `wp_is_large_network()`.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40590 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 15:50:04 +00:00