Commit Graph

36586 Commits

Author SHA1 Message Date
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
Felix Arntz 48661c4b00 Multisite: Introduce `minimum_site_name_length` filter.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40589 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 14:58:39 +00:00
Andrew Ozz 4469ab9d66 Editor: Add `wp.editor.remove()` for editors that were dynamically instantiated from JS.
Fixes: #35760

git-svn-id: https://develop.svn.wordpress.org/trunk@40588 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 03:40:30 +00:00
Andrew Ozz 3d2137f1b4 TinyMCE: improve adding of custom UI to the MCE Factory.
Props iseulde.
Fixes #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40587 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-09 01:39:49 +00:00
Andrea Fercia 6e868eed6e Themes: Fix missing search field in the Theme Install screen after [40572].
Props desrosj, cristianozanca for reporting.
Fixes #34881.


git-svn-id: https://develop.svn.wordpress.org/trunk@40586 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 15:58:52 +00:00
Andrew Ozz 656718a645 Fix linting errors in tinymce-obsolete.js.
See #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40585 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 06:05:39 +00:00
Andrew Ozz 1727d6fbef TinyMCE: remove the pre-4.6.0 tests. Move regression testing for obsolete tags and attributes to the default QUnit tests.
See #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40584 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 05:35:41 +00:00
Andrew Ozz f4d3513802 TinyMCE: update to 4.6.0. Has many new features and bug fixes, changelog: https://www.tinymce.com/docs/changelog/#version460-may42017.
Fixes #40690.

git-svn-id: https://develop.svn.wordpress.org/trunk@40583 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 05:31:08 +00:00
pento 491f14540e Emoji: Make the UN flag test more accurate.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@40582 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-08 05:00:29 +00:00
John Blackbourn 45b183ea79 Users: Correct a permission check when showing the User item in the `+ New` admin toolbar menu.
Props dlh
Fixes #39252


git-svn-id: https://develop.svn.wordpress.org/trunk@40581 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 17:41:24 +00:00
John Blackbourn d87cc35a5c Users: Clear the user settings cookies when clearing auth cookies.
This prevents lingering cookies when logging out and when switching between user accounts.

Props soulseekah, shanee
Fixes #32567


git-svn-id: https://develop.svn.wordpress.org/trunk@40580 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 16:53:51 +00:00
Andrea Fercia df479ac58e Administration: Restore missing spinner when installing a new language.
Fixes #40478.


git-svn-id: https://develop.svn.wordpress.org/trunk@40579 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 12:00:45 +00:00
Andrea Fercia cd239819b9 Accessibility: Make the Get Shortlink button be a real button.
Worth noting, as of WordPress 4.4, the Get Shortlink button is hidden by default
but it can be restored via filters.

Props Cheffheid.
See #26504.
Fixes #40448.


git-svn-id: https://develop.svn.wordpress.org/trunk@40578 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 11:46:52 +00:00
Joe Hoyle cc661013cf REST API: WP_REST_Request::remove_header() should canonicalize header names.
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40577 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-07 04:08:42 +00:00
Pascal Birchler 09fad66ae4 Administration: Remove unit and prefixed version from a CSS declaration.
The prefixed version gets added by Autoprefixer already.

Props MatheusFD.
Fixes #35358.


git-svn-id: https://develop.svn.wordpress.org/trunk@40576 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-06 14:36:17 +00:00
swissspidy fd211c9a2e Cron API: Add a new `wp_doing_cron()` helper function.
This replaces `DOING_CRON` checks via the constant.

Props tfrommen.
Fixes #39591.


git-svn-id: https://develop.svn.wordpress.org/trunk@40575 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-06 14:29:01 +00:00
Pascal Birchler 9a2188dd56 Embeds: Add screencast.com to oEmbed provider whitelist.
Props ENDif Media.
Fixes #38367.


git-svn-id: https://develop.svn.wordpress.org/trunk@40574 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-06 14:24:37 +00:00
Andrea Fercia f0b0147985 Accessibility: Improve the suggested image size text in the media views.
Adds `pixels` as unit, avoiding abbreviation for a clearer pronunciation by screen
readers. Also, adds the word `by` instead of the special character `times`.

Props Presskopp, stormrockwell.
Fixes #38932.


git-svn-id: https://develop.svn.wordpress.org/trunk@40573 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-05 23:28:41 +00:00
Andrea Fercia 3f6a8f2ca8 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40572 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-05 19:01:12 +00:00
Adam Silverstein c5595574d7 REST API: Improve strings added after 4.7 string freeze.
Clarify the `rest_orderby_include_missing_include` error message.

Props PranaliPatel.
Fixes #39178.


git-svn-id: https://develop.svn.wordpress.org/trunk@40571 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-05 18:48:09 +00:00
Andrea Fercia e49e372671 Accessibility: Improve the color contrast ratio of the dismiss notice buttons.
Props chris_dev.
Fixes #39970.


git-svn-id: https://develop.svn.wordpress.org/trunk@40570 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-04 22:31:17 +00:00
Andrea Fercia 859c3551ac 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40569 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-03 22:38:26 +00:00