Commit Graph

34808 Commits

Author SHA1 Message Date
Dominik Schilling 44676ab38f Plugins: Improve Ajax search of new plugins.
Fixes a few accessibility issues, restores the "Search Results" tab and the search type selector, and improves compatibility with older browsers.

Props rahulsprajapati, swissspidy, adamsilverstein, ocean90
See #37233.

git-svn-id: https://develop.svn.wordpress.org/trunk@38119 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:31:50 +00:00
Joe McGill 2586eeeeca Post Thumbnails: Only update featured images when saving a post.
Previously, changing the post thumbnail of a published post in the edit screen
would immediately apply the change, rather than waiting for the post to be
saved before applying the update. This could lead to someone unintentionally
editing the post thumbnail on a published post, and made it impossible to
preview changes to post thumbnails on published posts before saving the change.

This introduces a new Ajax handler, `wp_ajax_get_post_thumbnail_html()` to
retrieve the HTML for the post thumbnail meta box without updating the post
meta value for `_thumbnail_id`. It also allows post thumbnail changes to be
previewed by passing the `_thumbnail_id` as a query variable to the preview
screen and adding a new filter, `_wp_preview_post_thumbnail_filter()`, which
gets applied to `get_post_metadata` during the post preview process.

Props flixos90.
Fixes #12922.

git-svn-id: https://develop.svn.wordpress.org/trunk@38118 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:23:36 +00:00
Sergey Biryukov f5f8d1df2b Comments: Introduce the `cache_domain` argument for `WP_Comment_Query` to allow caching to a unique set of cache buckets.
See [18128] for `get_terms()` and [37572] for `WP_Term_Query`.

Props Chouby, rachelbaker.
Fixes #37419.

git-svn-id: https://develop.svn.wordpress.org/trunk@38117 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 15:06:19 +00:00
Joe McGill 1bda0a6e2e Media: Ensure empty `alt` attributes are set to blank strings.
This is a follow up to [38065] to ensure that `wp.html.string()` always
converts empty `alt` attributes to `alt=""` rather than returning HTML using
empty attribute notation, like `alt`. This allows screen readers to ignore
images with empty `alt` attributes, rather than reading out the URL string.

Additionally this completely removes the logic in `wp.html.string()` for
converting blank attributes to empty attribute notation since empty attribute
notation is generally meant to denote a boolean value, e.g.,
`checked` == `checked="checked"`, which doesn't apply in this context because
boolean attributes must be omitted in order to represent a `false` value.
See: https://www.w3.org/TR/html5/infrastructure.html#boolean-attributes

Props adamsilverstein, afineman, joemcgill.
Fixes #36735.

git-svn-id: https://develop.svn.wordpress.org/trunk@38116 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 14:37:24 +00:00
Andrea Fercia e284dafbc7 Accessibility: Ensure only text is sent to aria-live messages.
While messages passed to `wp.speak.a11y()` should preferably be meaningful,
short, and carefully crafted case by case, this will ensure any HTML tags will
be stripped out from the message string.

Props adamsilverstein.
Fixes #37382.

git-svn-id: https://develop.svn.wordpress.org/trunk@38115 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 14:25:34 +00:00
Rachel Baker 2cda326902 Tests: Include the `check_comment` function tests in the comment group.
Adds `@group comment` notation to the `Tests_Comment_CheckComment` class. Introduced in [32519].

Props gma992.
Fixes #37356.

git-svn-id: https://develop.svn.wordpress.org/trunk@38114 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 14:06:44 +00:00
Mike Schroder ffb2db0521 Media: Clean up prior image edits if `IMAGE_EDIT_OVERWRITE` is true.
When `IMAGE_EDIT_OVERWRITE` is set to true, edited image files are
supposed to be deleted when an image is restored to the original.

However, when an image was edited more than once, and then restored,
files created during previous edits were left behind.

Fixes this behavior by updating `wp_save_image()` to clean up
leftover images after each edit when `IMAGE_EDIT_OVERWRITE` is true.

Props bradt, chriscct7, joemcgill.
Fixes #32171.

git-svn-id: https://develop.svn.wordpress.org/trunk@38113 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 07:34:54 +00:00
Drew Jaynes 3dc7308bea Docs: Add missing class, method, and property DocBlocks for feed classes.
Covers:

* `WP_Feed_Cache`
* `WP_Feed_Cache_Transient`
* `WP_SimplePie_File`
* `WP_SimplePie_Sanitize_KSES`

Props ramiy, stevenkword.
Fixes #36295.


git-svn-id: https://develop.svn.wordpress.org/trunk@38112 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 07:32:26 +00:00
Gary Pendergast 62c518df0d Tools: Update `grunt-patch-wordpress` to 0.4.2.
This update fixes invalid patches being uploaded to Trac when the `diff-cmd` is set to `colordiff`.

Props jorbin.
Fixes #37410.



git-svn-id: https://develop.svn.wordpress.org/trunk@38111 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 06:48:26 +00:00
Andrew Ozz 616d4416e2 TinyMCE: replace the editor iframe title on MacOS to fix the help shortcut.
Props afercia, azaozz.
Fixes #36863.

git-svn-id: https://develop.svn.wordpress.org/trunk@38110 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 01:38:12 +00:00
Sergey Biryukov 79e7fca981 Permalinks: In `wp_install_maybe_enable_pretty_permalinks()`:
* Use `get_page_by_path()` instead of a hardcoded ID, which may not always exist.
* Remove the "test against a random 404 page" part, which is no longer relevant after [34442].

Fixes #36628.

git-svn-id: https://develop.svn.wordpress.org/trunk@38109 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 23:11:25 +00:00
Jeremy Felt 2a8fd61b0c Meta: Ensure `$wp_meta_keys` is an array in `get_registered_meta_keys()`.
Props vishalkakadiya.
Fixes #37415, See #35658.


git-svn-id: https://develop.svn.wordpress.org/trunk@38108 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 21:58:15 +00:00
Drew Jaynes 3aad67fd48 Docs: Use the three-digit, x.x.x-style version in the DocBlock for the nested `lowercase_octets()` function.
See #32246. See #meta942.


git-svn-id: https://develop.svn.wordpress.org/trunk@38107 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 19:33:31 +00:00
Drew Jaynes 5a286f7a1b Docs: Add a missing DocBlock for the `lowercase_octets()` function, which is nested within `redirect_canonical()`.
Will be skipped from parsing.

See #32246. See #meta942.


git-svn-id: https://develop.svn.wordpress.org/trunk@38106 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 19:31:31 +00:00
Drew Jaynes aa86283408 Readme: Link to the Plugin Developer Handbook on DevHub as the primary resource for information on extending WordPress.
The `Plugin API` article in the Codex is no longer actively maintained.

Props morganestes.
Fixes #37399.


git-svn-id: https://develop.svn.wordpress.org/trunk@38105 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 17:34:00 +00:00
Sergey Biryukov 0fbc96e5bc Docs: Clarify the `fields` argument description in `WP_Network_Query::__construct()`.
See #32504.

git-svn-id: https://develop.svn.wordpress.org/trunk@38104 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 13:17:51 +00:00
Sergey Biryukov a64a8ea726 Docs: Clarify the `fields` argument description in `WP_Site_Query::__construct()`.
Props ramiy.
See #35791.

git-svn-id: https://develop.svn.wordpress.org/trunk@38103 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 13:14:40 +00:00
Sergey Biryukov 87376166f2 Multisite: Correct default value for `orderby` in `WP_Network_Query::__construct()`.
Add a unit test.

See #32504.

git-svn-id: https://develop.svn.wordpress.org/trunk@38102 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 13:09:39 +00:00
Dominik Schilling b9606d3c4a Filesystem API: Ensure memory limit calculations by PclZip are using integers.
This prevents a warning in PHP trunk, see https://wiki.php.net/rfc/invalid_strings_in_arithmetic.

See #36435.

git-svn-id: https://develop.svn.wordpress.org/trunk@38101 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 11:54:09 +00:00
Peter Wilson b92c1c58b3 Script Loader: Limit resource hinting to enqueued assets.
Externally hosted script and style dependencies trigger `dns-prefetch` hinting only when enqueued. This removed a bug in which hinting was added on registration.

Renames the function `wp_resource_hints_scripts_styles` to `wp_dependencies_unique_hosts` as the function provides the hosts, not the hinting.

Props swissspidy.
Fixes #37385.


git-svn-id: https://develop.svn.wordpress.org/trunk@38100 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 02:34:42 +00:00
Boone Gorges 103da159d5 Taxonomy: Improve back compat of values passed to 'terms_clauses' filter.
Prior to the introduction of `WP_Term_Query`, the 'orderby' clause
passed to the 'terms_clauses' filter was prefixed by `ORDER BY`. After
`WP_Term_Query`, this was not the case; `ORDER BY` was added after the
filter. As such, plugins filtering 'terms_clauses' and returning an
'orderby' clause beginning with `ORDER BY` resulted in invalid syntax
when `WP_Term_Query` prepended a second `ORDER BY` keyword to
the clause.

This changeset rearranges the way the 'orderby' clause is built so that
it will be passed to 'terms_clauses' in the previous format.

Fixes #37378.

git-svn-id: https://develop.svn.wordpress.org/trunk@38099 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 02:12:48 +00:00
Rachel Baker 456d5b4880 Docs: Correct `comment_max_links_url` filter and `$url` param descriptions to communicate values are found links.
`$num_links` is the number of link matches found within the comment_content, and that is the value that can be modified with the `comment_max_links_url` filter.

Props pbearne.
Fixes #37319.

git-svn-id: https://develop.svn.wordpress.org/trunk@38098 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-19 01:48:23 +00:00
Weston Ruter 1aa4b6f87f Docs: Correct type of `WP_Post_Type::$cap` from `array` to `object`.
Fixes typo introduced in r37890. The `WP_Post_Type::$cap` property is set to the return value of `get_post_type_capabilities()` which is an `object`.

See #36217.


git-svn-id: https://develop.svn.wordpress.org/trunk@38097 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 22:51:39 +00:00
John Blackbourn 4a39dde8f5 Role/Capability: Introduce capability tests for non-logged-in users.
Fixes #37405


git-svn-id: https://develop.svn.wordpress.org/trunk@38096 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 22:38:18 +00:00
Jeremy Felt 4f2008a104 Meta: Remove object subtype handling from `register_meta()`.
Registration is now based solely on object type, which allows the code around this to be simplified significantly.

In the process of making this adjustment:

* `register_meta()`, `unregister_meta_key()`, `get_registered_metadata()`, and `registered_meta_key_exists()` no longer return `WP_Error` objects.
* The recently introduced `wp_object_type_exists()` function and the restriction on object type has been removed.

Note: No guarantee of uniqueness is made across object subtypes. Registered meta keys should be uniquely prefixed to avoid conflict.

Fixes #35658.


git-svn-id: https://develop.svn.wordpress.org/trunk@38095 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 21:15:37 +00:00
Dominik Schilling ff6d8819e4 Filesystem API: Cleanup temporary file when the temporary file couldn't be opened.
Props ruud@joyo.
See #34772.
Fixes #36942, #36943.

git-svn-id: https://develop.svn.wordpress.org/trunk@38094 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 19:42:48 +00:00
Tammie b55afe7f4d Remove .pot files from Default Themes
Fixes #34884
Props davidakennedy


git-svn-id: https://develop.svn.wordpress.org/trunk@38093 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 14:32:52 +00:00
Dominik Schilling cbbba23530 Comments: Use `wp_strip_all_tags()` to strip HTML tags.
`wp_kses()` should only be used if you have a whitelist.

Props rachelbaker.
Fixes #37208.

git-svn-id: https://develop.svn.wordpress.org/trunk@38092 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 14:03:04 +00:00
Dominik Schilling 5b6ab5a596 Plugins: Use the correct admin screen when searching for plugins via Ajax.
Both list tables provide different actions based on where they are loaded, regular admin or network admin. Since there is only one Ajax handler for both screens we have to set the current screen before using the list tables.

Props swissspidy, ocean90.
Fixes #37373.

git-svn-id: https://develop.svn.wordpress.org/trunk@38091 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 13:59:17 +00:00
Dominik Schilling 97c25ea5c1 Media: Add missing gettext to a string added in [38089].
See #37394.

git-svn-id: https://develop.svn.wordpress.org/trunk@38090 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 12:38:46 +00:00
Dominik Schilling 29dd928983 Media: Update list of translatable strings for MediaElement.js.
Fixes #37394.

git-svn-id: https://develop.svn.wordpress.org/trunk@38089 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 11:29:03 +00:00
Dominik Schilling 2beb89575b External Libraries: Update MediaElement.js to 2.22.0.
Includes a fix for broken YouTube embeds which are embedded with the `[video]` shortcode. 

Changelog: https://github.com/johndyer/mediaelement/blob/2.22.0/changelog.md
Diff: https://github.com/johndyer/mediaelement/compare/2.21.1...2.22.0

Fixes #37363.

git-svn-id: https://develop.svn.wordpress.org/trunk@38088 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 10:58:17 +00:00
Gary Pendergast 1ba5469262 Emoji: Update to Unicode 9.0 emoji.
This includes a new test in the emoji loader, to see if the browser supports rendering Unicode 9.0 emoji, as well as an update to `twemoji.js`, to load Unicode 9.0 twemoji images.

The default CDN location for loading Twemoji images has changed, moving to a versioned subdirectory. This allows updates without needing to purge the CDN.

Fixes #37361.



git-svn-id: https://develop.svn.wordpress.org/trunk@38087 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 07:34:24 +00:00
Joe McGill a91e769e36 Media: Prevent `image_get_intermediate_size()` from returning cropped images.
When `$size` is passed to `image_get_intermediate_size()` as an array of width
and height values and an exact image size matching those values isn't available,
the function loops through the available attachment sizes and returns the
smallest image larger than the requested dimensions with the same aspect ratio.

The aspect ratio check is skipped for the 'thumbnail' size to provide a fallback
for small sizes when no other image option is available. This resulted in a poor
selection when the size requested was smaller than the 'thumbnail' dimensions
but a larger size matching the requested ratio existed.

This refactors the internals of `image_get_intermediate_size()` to ensure the
'thumbnail' size is only returned as a fallback to small sizes once all other
options have been considered, and makes the control flow easier to follow.

This also introduces a new helper function, `wp_image_matches_ratio()` for
testing whether the aspect ratios of two sets of dimensions match. This function
is also now used in `wp_calculate_image_srcset()` during the selection process.

Props flixos, joemcgill.
Fixes #34384, #34980.

git-svn-id: https://develop.svn.wordpress.org/trunk@38086 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-18 02:13:45 +00:00
Sergey Biryukov 38bcf065df Multisite: Correct default values for `orderby` and `order` in `WP_Site_Query::__construct()`.
Add a unit test.

Props ramiy, SergeyBiryukov.
See #35791.

git-svn-id: https://develop.svn.wordpress.org/trunk@38085 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 23:29:11 +00:00
Andrea Fercia 7b833f38a6 Accessibility: Improve keyboard navigation on the themes browser modal window.
Improves the `containFocus()` function to always get the correct first and last
focusable elements, even when the theme browser shows the active theme details.
Also, when on the first and last theme, adds a `disabled` attribute on the
previous and next navigation buttons to make them not focusable.

Fixes #37383.

git-svn-id: https://develop.svn.wordpress.org/trunk@38084 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 22:18:35 +00:00
Weston Ruter 57fe32e081 Twenty Thirteen: Fix selective refresh of Masonry-laid out widgets by deferring initialization until DOM ready.
This ensures that the `wp.customize.selectiveRefresh` object will be available when in the Customizer preview.

Fixes #37390.
Props westonruter, celloexpressions.


git-svn-id: https://develop.svn.wordpress.org/trunk@38083 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 21:13:35 +00:00
Sergey Biryukov b87911eccb I18N: Remove non-translatable link attributes from translatable strings in `wp_plugin_update_row()`, `wp_theme_update_row()`, and `get_theme_update_available()`.
The resulting strings are much easier to translate.

See #36048.

git-svn-id: https://develop.svn.wordpress.org/trunk@38082 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 21:02:21 +00:00
Sergey Biryukov fd19901336 Text Changes: Change `Network deactivate %s` to upper case, for consistency with `Network Activate %s`.
See #37290.

git-svn-id: https://develop.svn.wordpress.org/trunk@38081 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 17:03:24 +00:00
Sergey Biryukov 4c5165a8d0 I18N: Combine duplicate "Menu Locations" and "Menu Options" strings.
Props ramiy.
See #18218.

git-svn-id: https://develop.svn.wordpress.org/trunk@38080 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 16:46:25 +00:00
Sergey Biryukov ad30724bb5 Taxonomy: Correct `WP_Error` usage in `WP_Tax_Query::clean_query()` and `WP_Tax_Query::transform_query()`.
Fixes #37389.

git-svn-id: https://develop.svn.wordpress.org/trunk@38079 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 16:32:50 +00:00
Sergey Biryukov 59f15cdea9 Unit Tests: Account for the string changes in [38077].
See #18218.

git-svn-id: https://develop.svn.wordpress.org/trunk@38078 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 16:23:31 +00:00
Sergey Biryukov 776b3c3f1d Text Changes: Add a full stop to "Invalid taxonomy" and "Invalid term ID" strings, for consistency with similar post-related messages.
See #18218, #32329.

git-svn-id: https://develop.svn.wordpress.org/trunk@38077 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 16:14:27 +00:00
Sergey Biryukov 8d81483b5e I18N: Combine two duplicate "Invalid post type" strings.
Props @ramiy.
See #18218.

git-svn-id: https://develop.svn.wordpress.org/trunk@38076 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 16:04:50 +00:00
Dominik Schilling 8756f2912f Import: Enhance accessibility on the Import screen.
* Remove title attributes.
* Show "Install Now" and "Details" links if the importer isn't installed yet.
* Show a "Run Importer" link if the importer is installed. It also handles activation if the plugin isn't activated.
* Add `aria-label` attributes to each link.
* Unify the importer descriptions to make them independent from the plugin state. The API was changed in [meta3690].
* Adjust JavaScript callbacks for ajaxified importer installs.

Props afercia, swissspidy, ocean90.
See #24766.
Fixes #35191.

git-svn-id: https://develop.svn.wordpress.org/trunk@38075 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 15:31:29 +00:00
Sergey Biryukov f160118827 I18N: Change unnecessary uppercased words in `WP_Upgrader::generic_strings()` to lower case.
See #18218.

git-svn-id: https://develop.svn.wordpress.org/trunk@38074 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 13:28:13 +00:00
Sergey Biryukov bc2a58755f I18N: Combine two duplicate "Unable to locate WordPress Theme directory" strings.
See #18218.

git-svn-id: https://develop.svn.wordpress.org/trunk@38073 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 12:57:06 +00:00
Sergey Biryukov 751f76fbaf Text Changes: After [37297], replace two more instances of "WordPress.org Plugin Directory" with "WordPress Plugin Directory".
See #35938.

git-svn-id: https://develop.svn.wordpress.org/trunk@38072 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-17 12:49:12 +00:00
Sergey Biryukov 8308164a77 I18N: After [38057], consistently use a context for other instances of `Activate %s`, `Network Activate %s`, and `Delete %s` strings.
See #37290.

git-svn-id: https://develop.svn.wordpress.org/trunk@38071 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-16 23:19:05 +00:00
Sergey Biryukov cd75368a3f I18N: Remove a stray translator comment added in [38057].
See #37290.

git-svn-id: https://develop.svn.wordpress.org/trunk@38070 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-16 23:10:49 +00:00