Commit Graph

35053 Commits

Author SHA1 Message Date
Dominik Schilling
24f890045c HTTP API: Normalize cookies before passing them to Requests.
Requests has its own cookie object in form of `Requests_Cookie`. Therefore we have to convert `WP_Http_Cookie` objects to `Requests_Cookie`.
This introduces `WP_Http_Cookie::get_attributes()` to retrieve cookie attributes of a `WP_Http_Cookie` object and `WP_Http::normalize_cookies()` to convert the cookie objects.

Fixes #37437.

git-svn-id: https://develop.svn.wordpress.org/trunk@38164 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 15:31:48 +00:00
Dominik Schilling
55e086355f HTTP API: Bump version of Requests to 1.7.
See #33055.

git-svn-id: https://develop.svn.wordpress.org/trunk@38163 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 14:54:57 +00:00
Sergey Biryukov
a2175c9ede I18N: After [38077], merge two duplicate strings in wp_insert_term() and wp_update_term().
Props ramiy.
See #18218.

git-svn-id: https://develop.svn.wordpress.org/trunk@38162 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 10:42:23 +00:00
Peter Wilson
d1aacf419e Script Loader: Clarify documentation of wp_resource_hints hook.
Specify that the `wp_resource_hints` hook is firing for a single relation type.

Props: dimadin for initial patch.
See #37458.


git-svn-id: https://develop.svn.wordpress.org/trunk@38161 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 10:35:04 +00:00
Andrew Ozz
e8c58c47db TinyMCE: fix the calculation for the inline toolbar vertical position.
Fixes #37481.

git-svn-id: https://develop.svn.wordpress.org/trunk@38160 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-27 02:58:27 +00:00
Andrew Ozz
d16d808d8b TinyMCE, inline link:
- Remove proxying through WordPress to test if an URL exists.
- Fix and enhance the regex that tests if the URL is well formed.

Fixes #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@38159 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 23:23:21 +00:00
Andrew Ozz
63980b7cf3 TinyMCE, wpView:
- Add the `wpview-wrap` class and pass third param to the getNodes() callback for back-compat.
- Attach the mutation observer that resizes a view iframe inside the iframe to minimize memory use/leaks.
- Remove the `wp-mce-view-unbind` event. It has never been particularly reliable and now it doesn't fire when the user deletes a view by typing or pasting over it.
- Restore changing of a view iframe body classes when the editor body classes change.

Props iseulde, azaozz.
Fixes #36434.

git-svn-id: https://develop.svn.wordpress.org/trunk@38158 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 23:12:14 +00:00
Andrew Ozz
10e93c557b TinyMCE, wpView: bail early when the iframe node is not attached to the DOM. We can't load any HTML in it as here is no iframe.contentWindow in these cases.
See #36434.

git-svn-id: https://develop.svn.wordpress.org/trunk@38157 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 22:05:39 +00:00
Andrew Ozz
a08e89ed97 TinyMCE: fix selecting an image on touch in iOS Safari for TinyMCE 4.4.1.
Fixes #37427.

git-svn-id: https://develop.svn.wordpress.org/trunk@38156 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 21:50:51 +00:00
Andrew Ozz
52ea1c53ac TinyMCE: upgrade to 4.4.1, changelog: https://www.tinymce.com/docs/changelog/#version441-july262016.
See #37427.
Fixes #37476.

git-svn-id: https://develop.svn.wordpress.org/trunk@38155 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 21:46:36 +00:00
Dominik Schilling
86b5cfcb83 Plugins: Use history.pushState() to customize the URL during searches.
`history.pushState()` requires an event handler for `popstate` which doesn't exist (yet).

Props rahulsprajapati for initial patch.
Fixes #37233.

git-svn-id: https://develop.svn.wordpress.org/trunk@38154 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 20:00:29 +00:00
Helen Hou-Sandi
7f6bfb42fe System fonts: Adjust the smaller tabs so they appear as tabs.
The tab effect comes from overlapping the border of the box below. Only applies to OSX; testing did not reveal adverse effects in other OSes.

props ocean90.
see #36753.


git-svn-id: https://develop.svn.wordpress.org/trunk@38153 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 16:45:16 +00:00
Helen Hou-Sandi
1e21bf9bf7 System fonts: Don't quote single-word font names, per our coding standards.
props ocean90, netweb.
see #36753.


git-svn-id: https://develop.svn.wordpress.org/trunk@38152 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-26 16:38:49 +00:00
Dominik Schilling
076cbcdb71 Filesystem API: Prevent an endless self-calling loop in wp_tempnam().
Under certain conditions upgrades on Windows may fail because `wp_tempnam()` gets called in a loop.
This can happen when `wp_tempnam()` is called with `\.maintenance` for the `$filename` parameter. The function strips the extension, in this case `.maintenance`, which results in an empty filename. Because it's empty, `wp_tempnam()` calls itself with `dirname( '\.maintenance' )`. On *nix systems this would be `"/"` which allows `wp_tempnam()` to fall back on `time()`. But on Windows it's `"\"`.

This change adds the backslash to the list of characters which allow `wp_tempnam()` to fall back on `time()`.

See [32322], [31936].
Fixes #33999.

git-svn-id: https://develop.svn.wordpress.org/trunk@38151 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-25 15:27:43 +00:00
Sergey Biryukov
7bf85ed296 I18N: Add a translator comment for two MediaElement.js strings added in [38089].
Props ideag.
See #37453, #37394.

git-svn-id: https://develop.svn.wordpress.org/trunk@38150 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-25 14:15:07 +00:00
Sergey Biryukov
cc9e4262ca Plugins: Add a missing space between classes on <td> element for custom columns of the Plugins list table.
Props crstauf.
Fixes #37460.

git-svn-id: https://develop.svn.wordpress.org/trunk@38149 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-25 13:27:42 +00:00
Sergey Biryukov
ad09174df2 Docs: In wp_schedule_single_event(), add a note about scheduling an event to occur within 10 minutes of another event with the same action hook.
Props medariox.
Fixes #37455.

git-svn-id: https://develop.svn.wordpress.org/trunk@38148 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-25 12:22:21 +00:00
Sergey Biryukov
22b3bdc333 Posts, Post Types: Remove a redundant function_exists( 'mb_strlen' ) check in get_sample_permalink_html().
`mb_strlen()` is always available since [32114].

See #30633.

git-svn-id: https://develop.svn.wordpress.org/trunk@38147 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 13:04:47 +00:00
Dominik Schilling
6f5f178e8c List Table: Improve WP_Plugins_List_Table::search_box() which was added in [38033].
* Update DocBlock to use third-person singular verb and to include a period at the end.
* Use `submit_button()` for the submit button.
* Escape the ID attribute.
* Apply the same to `WP_List_Table::search_box()`.

See #37230.

git-svn-id: https://develop.svn.wordpress.org/trunk@38146 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 10:58:23 +00:00
Sergey Biryukov
ccb70aee4b Permalinks: In get_page_uri(), don't prepend a parent page slug if it's empty.
Props inderpreet99, SergeyBiryukov.
Fixes #36174.

git-svn-id: https://develop.svn.wordpress.org/trunk@38145 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 10:04:20 +00:00
Sergey Biryukov
299802bbb5 Unit Tests: Add a @ticket reference for test_get_page_uri_without_argument().
See #26284.

git-svn-id: https://develop.svn.wordpress.org/trunk@38144 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 08:54:23 +00:00
Sergey Biryukov
4f23ce8545 Unit Tests: Move get_page_uri() tests to post/getPageUri.php, added in [37345].
See #26284.

git-svn-id: https://develop.svn.wordpress.org/trunk@38143 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-23 08:52:52 +00:00
Sergey Biryukov
65ba451f5b Docs: Update the description of the $box argument of wp_nav_menu_item_taxonomy_meta_box() for consistency with [38129].
Missed in [38130].

See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38142 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 16:50:01 +00:00
Dominik Schilling
0780b19984 Plugins: Make search field placeholder translatable.
See #37230.

git-svn-id: https://develop.svn.wordpress.org/trunk@38141 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 14:50:22 +00:00
Dominik Schilling
626169a8ce Docs: Fix typo in hook description for customize_save_validation_before.
See #37318.

git-svn-id: https://develop.svn.wordpress.org/trunk@38140 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 13:50:42 +00:00
Dominik Schilling
ec783d67b9 Docs: Fix minor formatting issue for a comment added in [38113].
See #32171.

git-svn-id: https://develop.svn.wordpress.org/trunk@38139 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 13:45:33 +00:00
Dominik Schilling
92231118dd Filesystem API: Change the default value for the $context parameter of get_filesystem_method() and request_filesystem_credentials() to an empty string.
`$context` is a full path to the directory that is tested for being writable. A path shouldn't be a boolean value.
This also updates `WP_Upgrader_Skin::request_filesystem_credentials()` and `Automatic_Upgrader_Skin::request_filesystem_credentials()` and adds missing docs.

Props DrewAPicture, ocean90.
Fixes #37412.


git-svn-id: https://develop.svn.wordpress.org/trunk@38138 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 12:09:55 +00:00
Dominik Schilling
b19f91f4bb Post Thumbnails: Remove an unused nonce in _wp_post_thumbnail_html().
See #12922.



git-svn-id: https://develop.svn.wordpress.org/trunk@38137 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 11:43:36 +00:00
Dominik Schilling
4fd98bb5ed Media: Remove global import for $content_width in _wp_post_thumbnail_html().
`$content_width` is unused since [35023].

See #28512.

git-svn-id: https://develop.svn.wordpress.org/trunk@38136 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 11:39:28 +00:00
Sergey Biryukov
fad2c0111b Docs: Fix typo in wp_title() description.
Props ixkaito.
Fixes #37442.

git-svn-id: https://develop.svn.wordpress.org/trunk@38135 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 10:44:05 +00:00
Dominik Schilling
db037aad34 Docs: Change type of WP_Upgrader_Skin::$result to 'string|bool|WP_Error'.
`$result` can be `true` too, see `Language_Pack_Upgrader::bulk_upgrade()`.

See #32246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38134 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-22 10:42:35 +00:00
Sergey Biryukov
e7bd22f87e Database: Replace incorrect use of E_USER_NOTICE in wpdb::_real_escape() with the version number where the message was added.
Props andizer.
Fixes #36403.

git-svn-id: https://develop.svn.wordpress.org/trunk@38133 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 22:44:26 +00:00
Sergey Biryukov
90d4614157 Editor: Improve styling of "Add Media" button on mobile and make it more consistent with media buttons added by plugins.
Props FolioVision.
Fixes #36999.

git-svn-id: https://develop.svn.wordpress.org/trunk@38132 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 21:53:09 +00:00
Sergey Biryukov
0c1b988a63 Docs: In meta box functions, clarify that "Meta box ID" refers to the id attribute of the meta box and not a numeric ID.
Fixes #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38131 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 19:23:56 +00:00
Sergey Biryukov
58e390d1ac Menus: In wp_nav_menu_item_taxonomy_meta_box():
* Rename the `$taxonomy` parameter to `$box` for clarity and consistency with other meta box functions.
* Make the docs more consistent with `post_categories_meta_box()` and other meta box functions.

See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38130 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 19:20:50 +00:00
Sergey Biryukov
48f6fddb49 Menus: In wp_nav_menu_item_post_type_meta_box():
* Rename the `$post_type` parameter to `$box` for clarity and consistency with other meta box functions.
* Make the docs more consistent with `post_format_meta_box()` and other meta box functions.
* Correct type and description for the third argument of `nav_menu_items_{$post_type_name}_recent` filter.

See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38129 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 19:18:36 +00:00
Sergey Biryukov
068ecc915c Docs: Correct and expand the docs for the $taxonomy argument of wp_nav_menu_item_taxonomy_meta_box().
Props mehulkaklotar for initial patch.
See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38128 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 18:00:41 +00:00
Sergey Biryukov
1db7b8441a Docs: Correct and expand the docs for the $post_type argument of wp_nav_menu_item_post_type_meta_box().
Props mehulkaklotar for initial patch.
See #37211.

git-svn-id: https://develop.svn.wordpress.org/trunk@38127 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 17:59:52 +00:00
Andrew Ozz
fb1fbcfdc0 TinyMCE, link check:
- Use `wp.a11y.speak()` to announce bad URLs.
- Do not add a title to the link toolbar.
- Better error message.

Props afercia, azaozz.
See #36638.

git-svn-id: https://develop.svn.wordpress.org/trunk@38126 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-21 03:41:17 +00:00
Drew Jaynes
7e52b06003 Docs: Fix formatting, tense, verb conjugation, and other syntax for wp-includes/* elements introduced or changed in 4.6.
Part 2/2.

Fixes #37318.


git-svn-id: https://develop.svn.wordpress.org/trunk@38125 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 19:32:05 +00:00
Dominik Schilling
22585895b3 Post WordPress 4.6 Beta 4 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@38124 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 18:42:54 +00:00
Dominik Schilling
fb6193a820 WordPress 4.6 Beta 4.
git-svn-id: https://develop.svn.wordpress.org/trunk@38123 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 18:31:44 +00:00
Dominik Schilling
63b7f3da1b Script Loader: Use dns-prefetch for the Emoji CDN.
* `preconnect` will be potentially pretty heavy on the CDN. With the Unicode 9.0 emoji update, almost all browsers will trigger the `preconnect`.
* `preconnect` only opens one connection, but `s.w.org` is HTTP/1.1, so the browser will use the preconnected connection for the first emoji, then it has to open new connections for subsequent emoji.

Also use the same URL as we use for the `emoji_svg_url` filter. This will print the hint for the correct CDN in case someone uses a custom CDN.

Props peterwilsoncc.
Fixes #37387.

git-svn-id: https://develop.svn.wordpress.org/trunk@38122 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 18:18:30 +00:00
Drew Jaynes
c750ff2d3c Docs: Fix formatting, tense, verb conjugation, and other syntax for wp-includes/* elements introduced or changed in 4.6.
Part 1/2.

See #37318.


git-svn-id: https://develop.svn.wordpress.org/trunk@38121 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:56:21 +00:00
Drew Jaynes
dd49a0512b Docs: Add missing inline documentation in WP_HTTP_Requests_Response.
* Adds a missing file header
* Adjusts class DocBlock
* Adds missing version and access information for all methods

See #37318, [37428] and #33055.


git-svn-id: https://develop.svn.wordpress.org/trunk@38120 602fd350-edb4-49c9-b593-d223f7449a82
2016-07-20 16:33:11 +00:00
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