Commit Graph

11051 Commits

Author SHA1 Message Date
Joe McGill
7e29c9646a Customizer: Minimize duplicate header crops in the media library.
This adds `Custom_Image_Header::get_previous_crop()`, which finds any
previously cropped headers created from the same base image and replaces
that attachment rather than creating a new attachment.

After updating a crop, the replaced images is also removed from the list
of previous header images in the Customizer.

See #21819.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 14:59:48 +00:00
K. Adam White
18d9cc6051 REST API: Specify specific json-schema version.
Explicitly specifies that the REST API uses JSON Schema draft-04,
as JSON Schema has deprecated versionless schema URIs and recommends
the use of a specific draft version.

Props @TimothyBlynJacobs
Fixes #41734


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


git-svn-id: http://core.svn.wordpress.org/trunk@41565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 14:52:46 +00:00
John Blackbourn
20f2edbb4e I18N: Improvements to the tests for plural forms.
* Move the `create_function()` code into a file that's only loaded, and into a test that's only run, on PHP <= 7.2 to avoid deprecated warnings in 7.2+.
* Convert the test skipping into a failure if the GlotPress locale file cannot be downloaded.
* Ensure `test_exceptions` fails if an exception is not thrown.
* Docs improvements

See #41562, #40109

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


git-svn-id: http://core.svn.wordpress.org/trunk@41564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 13:27:47 +00:00
Sergey Biryukov
44e23c2dab Twenty Sixteen: Make sure comment number comparison in comments.php works as expected.
`get_comments_number()` returns a numeric string, not an integer.

See #39660.
Built from https://develop.svn.wordpress.org/trunk@41729


git-svn-id: http://core.svn.wordpress.org/trunk@41563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 13:22:48 +00:00
Sergey Biryukov
e29c2f560b Template: Introduce readonly() form helper to complement the disabled() helper added in [13658].
Props soulseekah.
Fixes #16886.
Built from https://develop.svn.wordpress.org/trunk@41728


git-svn-id: http://core.svn.wordpress.org/trunk@41562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 13:19:48 +00:00
Joe Hoyle
f276b4901b REST API: Support for objects in schema validation and sanitization.
When registering routes developers can now define their complex objects in the schema and benefit from the automatic validation and sanitization in the REST API. This also paves the way for support for complex object registration via register_meta and register_setting.

See #38583.
Props TimothyBlynJacobs5.
Built from https://develop.svn.wordpress.org/trunk@41727


git-svn-id: http://core.svn.wordpress.org/trunk@41561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 08:27:47 +00:00
Weston Ruter
f8c6040ff5 Customize: Improve usability of Customize JS API.
* Eliminate need to pass both ID and instance in calls to `Values#add()` for panels, sections, controls, settings, partials, and notifications.
* Eliminate need to supply `content` param when constructing a `Control`.
* Unwrap the `options.params` object passed in constructors to just pass a flat `options`. (Back-compat is maintained.)
* Add support for `templateId` param for `Control` to override which template is used for the content.
* Remove unused `previewer` being supplied in `Control` instances.
* Rename `classes` to `containerClasses` on `Notification`.
* Automatically supply `instanceNumber` to improve stable sorting.
* Use `api.Notifications` for notifications in settings instead of `api.Value`.

See #30741.
Fixes #42083.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 06:48:46 +00:00
Gary Pendergast
3987df19fe Tests: Some tests in [41722] were using newer PHPUnit features.
`test_cache` used PHPUnit's object mocking to test some internal behaviour in `Plural_Forms`, but made use of the `willReturn()` method, which was introduced in PHPUnit 4.0 as shorthand for `will($this->returnValue())`. Fixed by switching to the longer form.

Several tests used the `@expectedException` directive to catch generic `Exception` exceptions, which was added in PHPUnit 3.7. Fixed by changing to an explicit `try` / `catch` test.

See #41562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 04:11:46 +00:00
Joe McGill
760f9fd3fd Media: Use max-width for default captions.
This alters the HTML output of the image caption shortcode to use
`max-width` instead of `width` to improve compatibility with
flexible layouts.

Props aaronrutley, desrosj.
Fixes #33981.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 02:50:46 +00:00
Gary Pendergast
4f48c60803 I18N: Fix a PHP error introduced in [41722].
PHP 5.2 and 5.3 don't support short array syntax, Ryan.

Fixes #41562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 02:12:46 +00:00
Gary Pendergast
0a3b7d8e31 I18N: Introduce the Plural_Forms class.
Historically, we've evaluated the plural forms for each language using `create_function()`. This is being deprecated in PHP 7.2, so needs to be replaced.

The `Plural_Forms` class parses the `Plural-Forms` header from the PO file, and internally caches the result of all subsequent plural form tests, allowing it to match the performance of the existing code.

Props rmccue.
Fixes #41562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 01:30:46 +00:00
Weston Ruter
5f7a5c1246 File Editors: Introduce sandboxed live editing of PHP files with rollbacks for both themes and plugins.
* Edits to active plugins which cause PHP fatal errors will no longer auto-deactivate the plugin. Supersedes #39766.
* Introduce sandboxed PHP file edits for active themes, preventing accidental whitescreening of a user's site when introducing a fatal error.
* After writing a change to a PHP file for an active theme or plugin, perform loopback requests on the file editor admin screens and the homepage to check for fatal errors. If a fatal error is encountered, roll back the edited file and display the error to the user to fix and try again.
* Introduce a secure way to scrape PHP fatal errors from a site via `wp_start_scraping_edited_file_errors()` and `wp_finalize_scraping_edited_file_errors()`.
* Moves file modifications from `theme-editor.php` and `plugin-editor.php` to common `wp_edit_theme_plugin_file()` function.
* Refactor themes and plugin editors to submit file changes via Ajax instead of doing full page refreshes when JS is available.
* Use `get` method for theme/plugin dropdowns.
* Improve styling of plugin editors, including width of plugin/theme dropdowns.
* Improve notices API for theme/plugin editor JS component.
* Strip common base directory from plugin file list. See #24048.
* Factor out functions to list editable file types in `wp_get_theme_file_editable_extensions()` and `wp_get_plugin_file_editable_extensions()`.
* Scroll to line in editor that has linting error when attempting to save. See #41886.
* Add checkbox to dismiss lint errors to proceed with saving. See #41887.
* Only style the Update File button as disabled instead of actually disabling it for accessibility reasons.
* Ensure that value from CodeMirror is used instead of `textarea` when CodeMirror is present.
* Add "Are you sure?" check when leaving editor when there are unsaved changes.

Supersedes [41560].
See #39766, #24048, #41886.
Props westonruter, Clorith, melchoyce, johnbillion, jjj, jdgrimes, azaozz.
Fixes #21622, #41887.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 00:20:45 +00:00
Weston Ruter
0909a73eed Customize: Let establish_loaded_changeset query changesets from any author not just current user when determining which changeset to autoload in non-branching mode.
See #39896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 00:01:46 +00:00
Felix Arntz
29e5ad5528 Multisite: Improve get_blog_details() by using get_site_by().
`get_site_by()` is now the preferred way to retrieve a site object by lookup for identifying data. By using a coherent structure and `get_sites()` internally, it has several advantages over the direct database queries and complex code in `get_blog_details()`. Therefore `get_blog_details()` is now a wrapper for `get_site_by()`, providing backward compatibility fixes where necessary.

Unit tests have been adjusted to account for the `blog-details` and `blog-lookup` cache groups, which are no longer needed.

Props spacedmonkey, jeremyfelt, flixos90.
Fixes #40228.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 19:40:46 +00:00
Felix Arntz
f821106df8 Multisite: Use WP_Network_Query in ms_load_current_site_and_network().
This gets rid of the last readonly direct database query for networks in core. 🎉

Props spacedmonkey.
Fixes #41762.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 19:26:49 +00:00
Felix Arntz
1130241bbd Multisite: Replace calls to refresh_blog_details() with clean_blog_cache().
Fixes #42077. See #40201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 19:05:46 +00:00
Felix Arntz
a9b8f70682 Multisite: Establish clean_blog_cache() as a replacement for refresh_blog_details().
Going forward, `clean_blog_cache()` is recommended to be used instead of `refresh_blog_details()`. It has been adjusted to match the functionality of the latter, with the exception that it always requires a site ID or object to be passed. The `refresh_blog_details` action has been deprecated in favor of the `clean_site_cache` action. The function itself is not formally deprecated at this point, but will likely be in the near future.

Props spacedmonkey.
Fixes #40201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 18:41:48 +00:00
Felix Arntz
0410474758 Multisite: Add specific tests for clean_blog_cache() and refresh_blog_details().
See #40201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 18:21:46 +00:00
John Blackbourn
2ad86e1e82 Docs: Correct some @since MU notation that was broken in [41200].
Every function introduced by MU was introduced in 3.0.0 as this was when MU was merged.

See #41509

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


git-svn-id: http://core.svn.wordpress.org/trunk@41548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 17:44:48 +00:00
John Blackbourn
f4f31bc598 Plugins: Introduce a singular and plural form for the plugin deletion error message.
Props eddhurst, SergeyBiryukov

Fixes #38918

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


git-svn-id: http://core.svn.wordpress.org/trunk@41547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 17:13:46 +00:00
John Blackbourn
1e1a48aaa0 Embeds: Remove the external oEmbed tests for YouTube.
These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

See #42076, #32714, #23149

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


git-svn-id: http://core.svn.wordpress.org/trunk@41546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 16:52:46 +00:00
Andrea Fercia
d8ea080526 Accessibility: Change all the #f00 and red to the official WordPress accent red.
WordPress should exclusively use colors from the official colors palette, see
https://make.wordpress.org/design/handbook/design-guide/foundations/colors/
Partially addresses accessibility color contrast ratio issues.

See #35622.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 16:03:32 +00:00
John Blackbourn
22fd6a190b Login and Registration: Add unit tests for wp_auth_check().
Props pbearne, birgire

Fixes #41860

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


git-svn-id: http://core.svn.wordpress.org/trunk@41544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 16:02:46 +00:00
Andrea Fercia
a452e2259b Customize: Fix invalid HTML and aria-describedby values.
- fixes invalid HTML and duplicate IDs
- as per the Accessibility coding standards, all new code must use explicitly associated form labels
- properly escapes a few HTML attributes

Props celloexpressions, afercia.
Fixes #42054.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:44:46 +00:00
Andrew Ozz
d0593d59be Tools: enable Grunt precommit task to run without requiring SVN or GIT.
Fixes #41957
Built from https://develop.svn.wordpress.org/trunk@41708


git-svn-id: http://core.svn.wordpress.org/trunk@41542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:20:46 +00:00
Sergey Biryukov
52ca3b18d2 HTTP API: Use WP_HTTP_Response::set_data() in ::__construct() instead of directly accessing the $data property.
Props tfrommen.
Fixes #41759.
Built from https://develop.svn.wordpress.org/trunk@41707


git-svn-id: http://core.svn.wordpress.org/trunk@41541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:18:46 +00:00
Sergey Biryukov
af4cda27cc Posts, Post Types: Simplify the wording in post locking notice.
Props munyagu.
Fixes #42023.
Built from https://develop.svn.wordpress.org/trunk@41706


git-svn-id: http://core.svn.wordpress.org/trunk@41540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 15:11:48 +00:00
Sergey Biryukov
190929cb6c Multisite: Change IP references in new site or user notifications to IP address for clarity.
Props gk.loveweb, bradparbs.
See #40382.
Built from https://develop.svn.wordpress.org/trunk@41705


git-svn-id: http://core.svn.wordpress.org/trunk@41539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 13:13:47 +00:00
Sergey Biryukov
806b2a5af1 Comments: Change IP references in moderation option labels and email notifications to IP address for clarity.
Props mako09, gk.loveweb, bradparbs.
Fixes #40382.
Built from https://develop.svn.wordpress.org/trunk@41704


git-svn-id: http://core.svn.wordpress.org/trunk@41538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 13:09:47 +00:00
Sergey Biryukov
f67678b59a Twenty Seventeen: Change tag cloud format to a list (<ul>) for better semantics and accessibility.
List markup allows screen reader users to know in advance how many tags are within the list.

Props sami.keijonen.
Fixes #40184.
Built from https://develop.svn.wordpress.org/trunk@41703


git-svn-id: http://core.svn.wordpress.org/trunk@41537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 12:17:46 +00:00
Gary Pendergast
369ad06c82 Emoji: Fix incorrect emoji encoding in PHP < 5.4.
[41701] included a bug with PHP < 5.4. Prior to then, `html_entity_decode()` decoded into `ISO-8859-1`, when we actually need it to use `UTF-8`.

Fixes #35293.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 09:57:47 +00:00
Gary Pendergast
a7a57df525 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. 🤞🏻


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


git-svn-id: http://core.svn.wordpress.org/trunk@41535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 07:12:50 +00:00
Jeremy Felt
7e190e496b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 04:40:46 +00:00
Weston Ruter
a3ad1e8c57 Customize: Update dashboard welcome link to point to themes panel in the customizer instead of themes admin screen.
Props celloexpressions.
Fixes #42050.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 04:13:46 +00:00
Jeremy Felt
a580793b82 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 04:10:49 +00:00
Weston Ruter
2d69c9ef4f Customize: Provide validation feedback for invalid Custom Link URLs in nav menu items.
Props RMarks, EGregor, umangvaghela123, andrew.taylor, celloexpressions, westonruter, voldemortensen.
Fixes #32816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 03:43:47 +00:00
Joe McGill
51ee4233f1 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 03:00:48 +00:00
Gary Pendergast
7e33702830 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 00:25:46 +00:00
Weston Ruter
8d79246606 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 00:22:49 +00:00
John Blackbourn
882a2a8042 Build/Test tools: Correctly delete attachment files used in the media and post thumbnail tests.
Props atanasangelovdev

Fixes #38264 

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


git-svn-id: http://core.svn.wordpress.org/trunk@41527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-03 00:09:46 +00:00
John Blackbourn
f9a5f5485d 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

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


git-svn-id: http://core.svn.wordpress.org/trunk@41526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 23:21:47 +00:00
Sergey Biryukov
50e03e19af 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.
Built from https://develop.svn.wordpress.org/trunk@41691


git-svn-id: http://core.svn.wordpress.org/trunk@41525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 23:00:46 +00:00
Sergey Biryukov
63402326c1 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.
Built from https://develop.svn.wordpress.org/trunk@41690


git-svn-id: http://core.svn.wordpress.org/trunk@41524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:30:46 +00:00
Sergey Biryukov
df0958697a 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.
Built from https://develop.svn.wordpress.org/trunk@41689


git-svn-id: http://core.svn.wordpress.org/trunk@41523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:15:33 +00:00
John Blackbourn
4a16295dc5 Docs: Standardise the format used for documenting parameters passed by reference.
See #35974, #41017

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


git-svn-id: http://core.svn.wordpress.org/trunk@41522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:14:46 +00:00
Sergey Biryukov
c5c5fb1cd3 Twenty Seventeen: Add missing labels for <aside role="complementary"> widget areas.
Props sami.keijonen.
Fixes #42056.
Built from https://develop.svn.wordpress.org/trunk@41687


git-svn-id: http://core.svn.wordpress.org/trunk@41521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:04:46 +00:00
John Blackbourn
9fdbe6538e Docs: Remove & prefixes from parameter documentation to avoid doc parsing errors.
Props sudar for the original patch.

See #35974

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


git-svn-id: http://core.svn.wordpress.org/trunk@41520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:03:33 +00:00
Sergey Biryukov
253541556e 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.
Built from https://develop.svn.wordpress.org/trunk@41685


git-svn-id: http://core.svn.wordpress.org/trunk@41519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:02:47 +00:00
Andrea Fercia
a42b9cebde 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 21:52:52 +00:00
Andrea Fercia
6a6795382a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:44:47 +00:00
Andrea Fercia
c56dbad284 Accessibility: Improve the Dashboard Nearby Events widget wp.a11y.speak() messages.
Avoids to announce the "city updated" message on page load.

Fixes #42037.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:25:45 +00:00
John Blackbourn
3dda9e9257 Embeds: Add oEmbed support for someecards.com.
Props someecards

Fixes #40792

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


git-svn-id: http://core.svn.wordpress.org/trunk@41515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:10:49 +00:00
John Blackbourn
7859e22ad5 Embeds: Switch the collegehumor.com oEmbed endpoint to HTTPS, as it redirects there by default now.
See #28507

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


git-svn-id: http://core.svn.wordpress.org/trunk@41514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 19:06:46 +00:00
Weston Ruter
d8d8a01134 Customize: Fix jumping behavior upon scrolling up when a sticky header has its description expanded.
Props delawski.
See #34343, #41879.
Fixes #41850.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:55:47 +00:00
Adam Silverstein
5087d26d2d 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:41:35 +00:00
Weston Ruter
df7af1ee21 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:40:48 +00:00
John Blackbourn
2e3581c3ad Embeds: Alignment following [41615].
See #38181

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


git-svn-id: http://core.svn.wordpress.org/trunk@41510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:38:46 +00:00
Adam Silverstein
896d779541 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:35:46 +00:00
John Blackbourn
acaf286151 Taxonomy: Add context and a translator comment to the new most_used label.
Fixes #41150

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


git-svn-id: http://core.svn.wordpress.org/trunk@41508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:25:46 +00:00
Konstantin Obenland
1e6810e433 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:11:46 +00:00
Weston Ruter
6db8e66b43 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 17:34:47 +00:00
Weston Ruter
31647252e7 Plugin Editor: Remove plugins_loaded from being re-triggered in plugin_sandbox_scrape().
Props jdgrimes.
Amends [41560].
Fixes #39766.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 17:07:49 +00:00
Weston Ruter
a83e4eb40e 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 04:12:47 +00:00
Peter Wilson
8294b40161 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 04:00:48 +00:00
Jeremy Felt
5ccf8eebb7 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:38:45 +00:00
Weston Ruter
728e44ab5a 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:37:46 +00:00
Jeremy Felt
bdd50f28b4 Docs: Clarify docs for hooked count/date updates
See #41017.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:20:47 +00:00
Jeremy Felt
78880a6a0b 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:09:44 +00:00
Jeremy Felt
b47cf7330c Multisite: Use get_networks() instead of a direct query in get_admin_users_for_domain().
Props spacedmonkey.
Fixes #41806.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 03:06:47 +00:00
Gary Pendergast
f0492c5da8 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 02:45:47 +00:00
Gary Pendergast
1603a9e067 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 02:11:47 +00:00
Jeremy Felt
abdfe59c28 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 01:44:47 +00:00
Gary Pendergast
5f19289fc2 Docs: Clarify the docs for wpdb::prepare().
Make the usage of the `%` wildcard in queries clearer.

Props jrf.
Fixes #41983.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 00:22:45 +00:00
Jeremy Felt
d5acf636b0 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 22:16:48 +00:00
Andrea Fercia
1f4dab28fe 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 13:48:46 +00:00
Adam Silverstein
e23b4e9269 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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 13:07:45 +00:00
Andrew Ozz
40d84f7503 Editor: Use editor.$ to improve removeSelectionMarker().
See #42029
Built from https://develop.svn.wordpress.org/trunk@41656


git-svn-id: http://core.svn.wordpress.org/trunk@41490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 10:33:47 +00:00
Andrew Ozz
5335ba8c20 Editor: pass the DOM library instance instead of a (fake) editor instance to getCursorMarkerSpan().
See #42029
Built from https://develop.svn.wordpress.org/trunk@41655


git-svn-id: http://core.svn.wordpress.org/trunk@41489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-01 09:42:47 +00:00
Felix Arntz
eedca8f3da 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 04:10:45 +00:00
Felix Arntz
5edfea22b9 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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 03:54:45 +00:00
Felix Arntz
b0aaa16b32 Multisite: Display correct roles in Network > Site Users screen for sites other than the main site.
Props jeremyfelt.
Fixes #42013.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 03:20:46 +00:00
Weston Ruter
e0c3951b08 Embeds: Cache oEmbeds in an oembed_cache custom post type instead of postmeta when there is no global $post.
Add processing of embeds to rich Text widget.

Props swissspidy, westonruter, ocean90, johnbillion.
See #40854, #39994, #40935.
Fixes #34115.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-30 01:15:48 +00:00
Weston Ruter
e90b5ee669 Customize: Remove unused JS variables to fix JSHint.
Amends [41649].
See #37661, #39896.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 22:04:47 +00:00
Weston Ruter
57044ac71e Customize: Improve interactions between the Themes panel and Publish Settings section.
* Deactivate the Themes panel immediately after changing selected status to non-publish.
* Animate publish settings button into view with publish button when collapsing Themes panel.
* Deactivate publish settings section and hide publish settings button entirely when customizer state is clean.
* Harden access of Themes panel in case it was removed by plugin.
* Fix throttling of `renderScreenshots` calls in `ThemesSection`.

Amends [41648], [41626].
See #37661, #39896, #34843.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 21:52:45 +00:00
Weston Ruter
76f590b99b Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context. Also includes an extensible framework for browsing and installing themes from other sources.

Also includes CSS auto-prefixing added via `grunt precommit:css`.

For details, see: https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/

Previously [38813] but reverted in [39140].
Fixes #37661, #34843, #38666.
Props celloexpressions, folletto, westonruter, karmatosed, melchoyce, afercia.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 20:13:50 +00:00
John Blackbourn
fb30317bad Build/Test tools: Partially revert [41367] as gd and exif aren't actually required to run WordPress.
See #41851

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


git-svn-id: http://core.svn.wordpress.org/trunk@41481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 19:57:47 +00:00
Andrew Ozz
309c5559b4 Editor: improve attaching a callback on editor init.
See #42029
Built from https://develop.svn.wordpress.org/trunk@41646


git-svn-id: http://core.svn.wordpress.org/trunk@41480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 19:12:47 +00:00
Andrew Ozz
e4bd7a86a6 Editor: Improve keeping text selection when switching between Visual and Text modes.
Props biskobe.
See #42029.
Built from https://develop.svn.wordpress.org/trunk@41645


git-svn-id: http://core.svn.wordpress.org/trunk@41479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 17:50:45 +00:00
Sergey Biryukov
c1686e75bf Posts, Post Types: Correct test_submitting_comment_to_trashed_post_returns_error().
`wp_trash_post()` accepts a post ID, not a `WP_Post` object.

See #42030.
Built from https://develop.svn.wordpress.org/trunk@41644


git-svn-id: http://core.svn.wordpress.org/trunk@41478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 15:10:47 +00:00
Andrew Ozz
8fc05d8fba TinyMCE: fix "flickering inline toolbar" in Chrome in RTL mode by not showing tooltips while an inline toolbar is shown.
Fixes #42018.
Built from https://develop.svn.wordpress.org/trunk@41643


git-svn-id: http://core.svn.wordpress.org/trunk@41477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 14:25:47 +00:00
Sergey Biryukov
79ffa7ff2a Posts, Post Types: In wp_delete_post(), wp_trash_post(), wp_untrash_post(), and wp_delete_attachment(), standardize on WP_Post as a return value and internal representation of the post data.
Props bor0, SergeyBiryukov.
Fixes #42030.
Built from https://develop.svn.wordpress.org/trunk@41642


git-svn-id: http://core.svn.wordpress.org/trunk@41476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 13:36:46 +00:00
Sergey Biryukov
6a2b59745e I18N: Use a consistent pattern for translator comments for placeholders in wp-admin/includes/dashboard.php.
See #41974.
Built from https://develop.svn.wordpress.org/trunk@41641


git-svn-id: http://core.svn.wordpress.org/trunk@41475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 11:44:45 +00:00
Sergey Biryukov
10c46f5751 I18N: Use a consistent pattern for translator comments for placeholders in Customizer and widget strings.
Props danieltj, Rahmohn.
Fixes #41974.
Built from https://develop.svn.wordpress.org/trunk@41640


git-svn-id: http://core.svn.wordpress.org/trunk@41474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 11:42:48 +00:00
Sergey Biryukov
033b371145 I18N: Improve i18n in help text for Custom HTML widget and Additional CSS section.
Fixes #42032.
Built from https://develop.svn.wordpress.org/trunk@41639


git-svn-id: http://core.svn.wordpress.org/trunk@41473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 11:10:50 +00:00
Sergey Biryukov
70925e6741 Posts, Post Types: Introduce pre_trash_post and pre_untrash_post filters to allow for short-circuiting wp_trash_post() and wp_untrash_post().
This brings parity with `pre_delete_post` filter in `wp_delete_post()`, introduced in [34082].

Props bor0.
Fixes #42030.
Built from https://develop.svn.wordpress.org/trunk@41638


git-svn-id: http://core.svn.wordpress.org/trunk@41472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 10:19:49 +00:00
John Blackbourn
32b555d0a7 Build/Test tools: Update the WP_PHPUnit_Util_Getopt class for PHP 7.2 compatibility.
This removes usage of `each()` which is deprecated in PHP 7.2.

Props ayeshrajans

See #40109
Fixes #41525

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


git-svn-id: http://core.svn.wordpress.org/trunk@41471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 23:15:47 +00:00
John Blackbourn
d306285fa2 Build/Test tools: Update some test cases in anticipation of code formatting corrections.
These two tests assume a certain level of indentation in code which does not conform to core's coding
standards and will hopefully be corrected at some point in #41057.

See #41057

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


git-svn-id: http://core.svn.wordpress.org/trunk@41470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 22:56:50 +00:00
Dominik Schilling
9e097490af Embeds: In switched state, restore previous state if no post ID is found.
Fixes #40673.
Built from https://develop.svn.wordpress.org/trunk@41634


git-svn-id: http://core.svn.wordpress.org/trunk@41469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 16:29:45 +00:00
John Blackbourn
0d629ec963 External Libraries: Update the Text_Diff_Engine_native class for PHP 7.2 compatibility.
This removes usage of `each()` and usage of text strings passed to `assert()`.

Props bor0

Fixes #41526

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


git-svn-id: http://core.svn.wordpress.org/trunk@41468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 13:59:45 +00:00
Gary Pendergast
c805479c8b Docs: Update the documentation for wpdb::prepare()
The inline documentation for `wpdb::prepare()` was kind of confusing, and didn't describe some of the behaviour correctly.

Fixes #41983.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-28 11:45:45 +00:00