Commit Graph

37529 Commits

Author SHA1 Message Date
Gary Pendergast
d3e0b4bc16 Emoji: Bring Twemoji compatibility to PHP.
This was previously attempted in [41043], which unfortunately had severe performance issues, the regex it used was fatally slow on long posts.

This version now uses an array of all emoji that Twemoji supports, which maintains the accuracy of [41043], while being the same speed or only a few ms slower than the code prior to [41043].

As with [41043], the `grunt precommit:emoji` task detects when `twemoji.js` has changed, and regenerates the array.

Props jmdodd for feedback, suggestions, and insults where appropriate.
Fixes #35293. 🤞🏻



git-svn-id: https://develop.svn.wordpress.org/trunk@41701 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 07:11:28 +00:00
Jeremy Felt
d4814228dc Multisite: Use %s when building query for archived sites in WP_Site_Query.
In [25548], the `archived` column in `wp_blogs` was changed from `ENUM` to `TINYINT` to match other status fields. When `WP_Site_Query` was written later, it used `%d` as a placeholder when formatting the archived status.

It is possible that this query will fail for any installations that did not update the schema for `wp_blogs` as only single quoted values are accepted for the `ENUM` type. In this case, `'0'` or `'1'` rather than `0` or `1`.

We can work around this and support both `ENUM` and `TINYINT` in the query by using the `%s` placeholder and casting the value with `absint()`.

Props stephdau.
Fixes #38856. See #27832.


git-svn-id: https://develop.svn.wordpress.org/trunk@41700 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 04:39:08 +00:00
Weston Ruter
bebc4cde6f Customize: Update dashboard welcome link to point to themes panel in the customizer instead of themes admin screen.
Props celloexpressions.
Fixes #42050.


git-svn-id: https://develop.svn.wordpress.org/trunk@41699 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 04:12:51 +00:00
Jeremy Felt
5fc09374c2 Multisite: Introduce get_site_by().
`get_site_by()` is a replacement for `get_blog_details()` that uses `WP_Site_Query` to retrieve specific sites based on a given field and value.

Props flixos90, spacedmonkey.
Fixes #40180.


git-svn-id: https://develop.svn.wordpress.org/trunk@41698 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 04:09:50 +00:00
Weston Ruter
2e5f329cc9 Customize: Provide validation feedback for invalid Custom Link URLs in nav menu items.
Props RMarks, EGregor, umangvaghela123, andrew.taylor, celloexpressions, westonruter, voldemortensen.
Fixes #32816.


git-svn-id: https://develop.svn.wordpress.org/trunk@41697 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 03:43:01 +00:00
Joe McGill
57b92c4116 Widgets: Default to "custom URL" in the image widget.
This changes the default value for `link_type` in the image widget
schema to 'custom'.

Props bor0, desrosj.
Fixes #41629.


git-svn-id: https://develop.svn.wordpress.org/trunk@41696 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 02:59:03 +00:00
Gary Pendergast
942482993d Plugins: Add plugin icons to the plugin list tables.
To mirror theme list table behaviour, the plugin icon now appears next to plugins in the plugin list tables. For plugins that don't have an icon, or non-W.org plugins, a fallback dashicon is shown.

Props melchoyce, afercia, paulwilde, pento, obenland.
Fixes #30186.



git-svn-id: https://develop.svn.wordpress.org/trunk@41695 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 00:24:31 +00:00
Weston Ruter
88db798f62 Customize: Add button in Publish Settings to discard unsaved changes (including drafted and scheduled), reverting Customizer to the last published state.
Props westonruter, melchoyce.
Amends [41667].
See #39896, #21666.


git-svn-id: https://develop.svn.wordpress.org/trunk@41694 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 00:21:06 +00:00
John Blackbourn
e95d1428d1 Build/Test tools: Correctly delete attachment files used in the media and post thumbnail tests.
Props atanasangelovdev

Fixes #38264 


git-svn-id: https://develop.svn.wordpress.org/trunk@41693 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-03 00:08:16 +00:00
John Blackbourn
1e16e5eee8 I18N: Allow the login screen language to be specified via a wp_lang query variable, and use this for the interim login modal.
This allows users who are using the admin area in a language other than the site language to read the notice on the login screen
(which explains that they need to log in again) in their chosen language.

Props Nikschavan, swissspidy

Fixes #40205


git-svn-id: https://develop.svn.wordpress.org/trunk@41692 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 23:20:12 +00:00
Sergey Biryukov
b0c40f74d4 Login and Registration: Introduce login_title filter for the <title> tag content on login page.
The new filter mirrors the `admin_title` filter used on admin pages.

Props nishitlangaliya, henry.wright, SergeyBiryukov.
Fixes #40812.

git-svn-id: https://develop.svn.wordpress.org/trunk@41691 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:59:25 +00:00
Sergey Biryukov
d12b5a5b98 Login and Registration: Make the order of <title> tag parts on login page consistent with the rest of admin pages.
Props nishitlangaliya, henry.wright.
Fixes #40814.

git-svn-id: https://develop.svn.wordpress.org/trunk@41690 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:29:55 +00:00
Sergey Biryukov
6bd89722fa Comments: Pass $comment object to comment actions:
* `delete_comment`
* `deleted_comment`
* `trash_comment`
* `trashed_comment`
* `untrash_comment`
* `untrashed_comment`
* `spam_comment`
* `spammed_comment`
* `unspam_comment`
* `unspammed_comment`

Props henry.wright.
Fixes #41228.

git-svn-id: https://develop.svn.wordpress.org/trunk@41689 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:13:29 +00:00
John Blackbourn
19c0a55711 Docs: Standardise the format used for documenting parameters passed by reference.
See #35974, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41688 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:13:04 +00:00
Sergey Biryukov
2669a8f16e Twenty Seventeen: Add missing labels for <aside role="complementary"> widget areas.
Props sami.keijonen.
Fixes #42056.

git-svn-id: https://develop.svn.wordpress.org/trunk@41687 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:03:10 +00:00
John Blackbourn
dd33fc9301 Docs: Remove & prefixes from parameter documentation to avoid doc parsing errors.
Props sudar for the original patch.

See #35974


git-svn-id: https://develop.svn.wordpress.org/trunk@41686 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:01:23 +00:00
Sergey Biryukov
922ffc4190 Widgets: Pass $instance to widget argument filters:
* `widget_archives_dropdown_args`
* `widget_archives_args`
* `widget_categories_dropdown_args`
* `widget_categories_args`
* `widget_meta_poweredby`
* `widget_pages_args`
* `widget_comments_args`
* `widget_posts_args`
* `widget_tag_cloud_args`

See [33971] for `widget_links_args` and [34662] for `widget_nav_menu_args`.

Props Takahashi_Fumiki.
Fixes #38017.

git-svn-id: https://develop.svn.wordpress.org/trunk@41685 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 22:01:19 +00:00
Andrea Fercia
e2c4ae805f Quick/Bulk Edit: Improve the inline error messages styling.
- uses the core `notice` styles for the Quick Edit form inline error messages
- adds missing periods at the end of a few error messages

Props ocean90, karmatosed, melchoyce, afercia.
Fixes #35496.


git-svn-id: https://develop.svn.wordpress.org/trunk@41684 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 21:51:09 +00:00
Andrea Fercia
02588452f7 Accessibility: List Tables: use aria-current for the views current link.
The `aria-current` attribute is a simple, effective way to help assistive
technologies users orientate themselves within a list of items. Continues the 
introduction in core of the `aria-current` attribute after [41359] and [41371].

Props joedolson, flixos90, afercia.
Fixes #32399.


git-svn-id: https://develop.svn.wordpress.org/trunk@41683 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:43:02 +00:00
Andrea Fercia
54153520f2 Accessibility: Improve the Dashboard Nearby Events widget wp.a11y.speak() messages.
Avoids to announce the "city updated" message on page load.

Fixes #42037.


git-svn-id: https://develop.svn.wordpress.org/trunk@41682 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:24:24 +00:00
John Blackbourn
93fc60f36a Embeds: Add oEmbed support for someecards.com.
Props someecards

Fixes #40792


git-svn-id: https://develop.svn.wordpress.org/trunk@41681 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:09:46 +00:00
John Blackbourn
a89374bc30 Embeds: Switch the collegehumor.com oEmbed endpoint to HTTPS, as it redirects there by default now.
See #28507


git-svn-id: https://develop.svn.wordpress.org/trunk@41680 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 19:05:18 +00:00
Weston Ruter
64f0d4a544 Customize: Fix jumping behavior upon scrolling up when a sticky header has its description expanded.
Props delawski.
See #34343, #41879.
Fixes #41850.


git-svn-id: https://develop.svn.wordpress.org/trunk@41679 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:54:22 +00:00
Adam Silverstein
10488d5fdc WP-API JS Client: Improve support for meta.
* Add/fix `getMeta`, `getMetas`, `setMeta` and `setMetas` helpers for models that support meta.
* Add tests for new helpers, verify meta support for `Posts`, `Comments`, `Tags` and `Users`.
* Include meta data in fixture generation and fixture file driving tests.

Fixes #41055.


git-svn-id: https://develop.svn.wordpress.org/trunk@41678 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:39:30 +00:00
Weston Ruter
ba07b22cb5 Customize: Fix positioning of outer section (e.g. publish settings) on large screen sizes.
Also fix preview link CSS for desktop and mobile.

Props sayedwp, bduclos.
See #39896.
Fixes #42051.


git-svn-id: https://develop.svn.wordpress.org/trunk@41677 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:39:10 +00:00
John Blackbourn
493805239e Embeds: Alignment following [41615].
See #38181


git-svn-id: https://develop.svn.wordpress.org/trunk@41676 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:37:53 +00:00
Adam Silverstein
f2eb141e77 Menus: Increase timeout for QUnit wpNavMenu trigger tests.
Fix an (intermittent) issue where the final assertion verifying all hooks have been triggered ran too early, resulting in the test failing. 

Fixes #31218.


git-svn-id: https://develop.svn.wordpress.org/trunk@41675 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:34:53 +00:00
John Blackbourn
42a74c2aef Taxonomy: Add context and a translator comment to the new most_used label.
Fixes #41150


git-svn-id: https://develop.svn.wordpress.org/trunk@41674 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:24:46 +00:00
Konstantin Obenland
4666f2fd39 Widgets: Revert format of sidebars_widgets.
Restores the data format of the `sidebars_widgets` theme mod to its pre [41555]
format. It can trigger PHP warnings after switching themes if that mod has not
been removed previously.

Fixes #39693.



git-svn-id: https://develop.svn.wordpress.org/trunk@41673 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 18:10:06 +00:00
Weston Ruter
32a6ac3918 Customize: Improve styling of date/time Customizer control.
* Let date `legend` be screen reader text when time is not included.
* Skip rendering containers for label (title) and description when not supplied in registered control.
* Fix margins and padding.

Amends [41670].
Props westonruter, afercia, sayedwp.
Fixes #42022.


git-svn-id: https://develop.svn.wordpress.org/trunk@41672 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 17:33:10 +00:00
Weston Ruter
e8e027e7a6 Plugin Editor: Remove plugins_loaded from being re-triggered in plugin_sandbox_scrape().
Props jdgrimes.
Amends [41560].
Fixes #39766.


git-svn-id: https://develop.svn.wordpress.org/trunk@41671 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 17:06:46 +00:00
Weston Ruter
ef14cd1952 Customize: Fix WP_Customize_Date_Time_Control to be re-usable for plugins and custom settings.
* Allow time fields to be omitted by constructing with `timeIncluded` as `false`.
* Ensure `reportValidity` is only called on a control when it is in an expanded section.
* Rename "ampm" to "meridian".
* Improve accessibility and fix HTML validation and style issues for both the date/time control and the preview link control.
* Fix styling of dropdowns and clean CSS.
* Improve accessibility of nav menus component.

Props westonruter, afercia, sayedwp, melchoyce.
Amends [41626].
See #39896.
Fixes #42022.


git-svn-id: https://develop.svn.wordpress.org/trunk@41670 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 04:11:50 +00:00
Peter Wilson
1059c44025 Emoji: Refactor browser support tests.
Moves the repeated code in the emoji browser support test to a function to reduced the potential for errors and follow DRY principles.

Renames the "emoji4" test "emoji" as unicode version specific tests were removed in [38869].

Props peterwilsoncc, pento for code review.
Fixes #41156.



git-svn-id: https://develop.svn.wordpress.org/trunk@41669 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:59:50 +00:00
Jeremy Felt
28b28b581a Multisite: Deprecate is_user_option_local().
`is_user_option_local()` was added during MU development and used for a handful of changesets before the code using it was removed again. It has not been used by MU or core since nor is it widely used elsewhere.

Fixes #41697.
Props bnap00, jeremyfelt.


git-svn-id: https://develop.svn.wordpress.org/trunk@41668 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:37:29 +00:00
Weston Ruter
3fbb8ed287 Customize: Add infrastructure for trashing/reverting of unpublished changes; introduce full-screen OverlayNotification for trashing and theme install/preview.
* Introduce a new `wp.customize.previewer.trash()` JS API to trash the current changeset, along with logic to `WP_Customize_Manager` to handle deleting changeset drafts.
* Add `trashing` to `wp.customize.state` which is then used to update the UI.
* UI for trashing is pending design feedback. One possibility is to add a new trash button to Publish Settings section that invokes `wp.customize.previewer.trash()`.
* Improve logic for managing the visibility and disabled states for publish buttons.
* Prevent attempting `requestChangesetUpdate` while processing and bump processing while doing `save`.
* Update `changeset_date` state only if sent in save response.
* Merge `ThemesSection#loadThemePreview()` into `ThemesPanel#loadThemePreview()`.
* Remove unused `autosaved` state.
* Start autosaving and prompting at beforeunload after a change first happens. This is key for theme previews since even if a user did not make any changes, there were still dirty settings which would get stored in an auto-draft unexpectedly.
* Allow `Notification` to accept additional `classes` to be added to `container`.
* Introduce `OverlayNotification` and use for theme installing, previewing, and trashing. Such overlay notifications take over the entire window.

Props westonruter, celloexpressions.
See #37661, #39896, #21666, #35210.


git-svn-id: https://develop.svn.wordpress.org/trunk@41667 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:36:18 +00:00
Jeremy Felt
8db1a09d09 Docs: Clarify docs for hooked count/date updates
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41666 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:19:17 +00:00
Jeremy Felt
d271e5d356 Multisite: Only update a site's post count when post types of post are updated.
Previously, the query to update the count of published posts would run every time any post type transitioned between a `publish`/non-published status or was deleted.

Props sboisvert, JPry, spacedmonkey.
Fixes #42021.


git-svn-id: https://develop.svn.wordpress.org/trunk@41665 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:08:18 +00:00
Jeremy Felt
e7c17229df Multisite: Use get_networks() instead of a direct query in get_admin_users_for_domain().
Props spacedmonkey.
Fixes #41806.


git-svn-id: https://develop.svn.wordpress.org/trunk@41664 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 03:05:47 +00:00
Gary Pendergast
d16b885730 Database: Fix some PHP errors introduced in [41662].
PHP < 5.4 requires a `$matches` parameter to be passed to `preg_match_all()`

`wpdb::prepare()` can be called before translations are loaded, so needs appropriate `wp_load_translations_early()` calls.

See #42040.



git-svn-id: https://develop.svn.wordpress.org/trunk@41663 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 02:44:48 +00:00
Gary Pendergast
b4a6de9997 Database: Throw a notice if wpdb::prepare() is called with an incorrect number of arguments
`wpdb::prepare()` currently gives no information if the number of arguments passed doesn't match the number of placeholders in the query. This change gives an explicit notice that the call was incorrect.

Also fixes an enrelated term meta test that was triggering this new notice.

Props thekt12 for the initial patch.
Fixes #42040.



git-svn-id: https://develop.svn.wordpress.org/trunk@41662 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 02:10:14 +00:00
Jeremy Felt
e02c481487 Multisite: Use get_current_blog_id() instead of $wpdb->blogid.
`get_current_blog_id()` is more appropriate for determining the ID of the current site in most cases. This eliminates the need for the global `$wpdb` in several functions and is better than the implicit global used in admin pages.

Props bnap00, spacedmonkey.
Fixes #41684.


git-svn-id: https://develop.svn.wordpress.org/trunk@41661 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 01:43:48 +00:00
Gary Pendergast
ea23ff3422 Docs: Clarify the docs for wpdb::prepare().
Make the usage of the `%` wildcard in queries clearer.

Props jrf.
Fixes #41983.



git-svn-id: https://develop.svn.wordpress.org/trunk@41660 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-02 00:21:06 +00:00
Jeremy Felt
38d5112c25 Build/Test Tools: Add ms-files test group to sub-task list.
Previously, the `ms-files` test group would not run in any automatic configuration. This ensures it is always run as part of the test suite in Travis CI.

Props netweb.
Fixes #41698.


git-svn-id: https://develop.svn.wordpress.org/trunk@41659 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 22:15:16 +00:00
Andrea Fercia
7a414342df Accessibility: Improve the Theme Details modal accessibility.
- sets the modal content to `role="document"` to make screen readers switch back to browse mode
- standardizes the Themes screen and Customizer modals interaction
- Themes screen modal: sets initial focus on the modal overlay instead of the primary button, avoiding to "skip" content for keyboard and screen reader users

Fixes #42055.


git-svn-id: https://develop.svn.wordpress.org/trunk@41658 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 13:47:29 +00:00
Adam Silverstein
625773bd8b REST API JavaScript Client: improve support for model deletion/trash.
Update the way and location the JavaScript client determines which models/endpoints require the `force=true` parameter when being deleted to avoid a `rest_trash_not_supported` error. Identify models with endpoints that support DELETE, excluding those that support the trash (posts and pages by default). Also, move the check into the default `wp.api.WPApiBaseModel.initialize()` function.

Props caercam, euthelup.
Fixes #40672.



git-svn-id: https://develop.svn.wordpress.org/trunk@41657 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 13:06:43 +00:00
Andrew Ozz
a0692f9597 Editor: Use editor.$ to improve removeSelectionMarker().
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41656 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 10:32:58 +00:00
Andrew Ozz
d36c32e299 Editor: pass the DOM library instance instead of a (fake) editor instance to getCursorMarkerSpan().
See #42029

git-svn-id: https://develop.svn.wordpress.org/trunk@41655 602fd350-edb4-49c9-b593-d223f7449a82
2017-10-01 09:41:23 +00:00
Felix Arntz
84daf097a0 Multisite: Fix wp_get_users_with_no_role() possibly including users with a role on a different site.
Prior to this change, when passing another site than the current one to `wp_get_users_with_no_role()` through its `$site_id` parameter, the function still used the roles available on the current site, which would cause users with other roles that possibly exist on the other site to show up as users without a role. Switching the site before retrieving the available rules fixes the issue.

Fixes #42015.


git-svn-id: https://develop.svn.wordpress.org/trunk@41654 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 04:09:11 +00:00
Felix Arntz
761c45157e Multisite: Fix count_users() possibly querying incorrect roles when passed a different site ID.
The `time` strategy in `count_users()` queries users by role. However, the roles queried for were not affected by passing another site than the current one through the `$site_id` parameter, causing users having roles that were not queried for to appear as users without a role. This changeset fixes the issue by switching the site before retrieving the roles to query for.

Fixes #42014.


git-svn-id: https://develop.svn.wordpress.org/trunk@41653 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 03:53:27 +00:00
Felix Arntz
75c4cb98f4 Multisite: Display correct roles in Network > Site Users screen for sites other than the main site.
Props jeremyfelt.
Fixes #42013.


git-svn-id: https://develop.svn.wordpress.org/trunk@41652 602fd350-edb4-49c9-b593-d223f7449a82
2017-09-30 03:19:26 +00:00