Commit Graph

34515 Commits

Author SHA1 Message Date
Pascal Birchler
931440e375 Embeds: Enforce a valid post ID when embedding a post from the current site.
Otherwise `wp_filter_pre_oembed_result()` could erroneously return the HTML of the current post instead of the intended result.

Props kraftbj.
See #36767.

git-svn-id: https://develop.svn.wordpress.org/trunk@37729 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 17:17:32 +00:00
Dominik Schilling (ocean90)
eefd425f66 Media: Use the correct variable for the file object.
See #14244.

git-svn-id: https://develop.svn.wordpress.org/trunk@37728 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 16:14:25 +00:00
Dominik Schilling (ocean90)
41823be421 Media: Pass allowed file extensions to Plupload.
Plupload's `mime_types` filter (http://www.plupload.com/docs/Options#filters.mime_types) allows us to inform a user about an unsupported file before the file gets uploaded.

Props polevaultweb.
Fixes #14244.

git-svn-id: https://develop.svn.wordpress.org/trunk@37727 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 15:38:12 +00:00
Rachel Baker
7a4e523b5e REST API: Include X-Robots-Tag: noindex header in REST API responses to prevent endpoints from being indexed by search engines.
Prevent duplicate content issues with search engines and REST API endpoint response data.

Fixes #36390.
Props m_uysl for the initial patch.

git-svn-id: https://develop.svn.wordpress.org/trunk@37726 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 14:58:28 +00:00
Dominik Schilling (ocean90)
f50f50cd0b Customize: Separate preview and actions in the site icon control.
Reverts [37456] to allow users to remove/change a site icon even if the attachment has corrupt/missing data about sizes.

Fixes #36749.

git-svn-id: https://develop.svn.wordpress.org/trunk@37724 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 09:44:21 +00:00
Dominik Schilling (ocean90)
62bd8ecdd7 External Libraries: Update Backbone to version 1.3.3.
Changelog: https://cdn.rawgit.com/jashkenas/backbone/1.3.3/index.html#changelog
Diff: https://github.com/jashkenas/backbone/compare/1.2.3...1.3.3

Includes a unit test to ensure that the minified version doesn't include `sourceMappingURL`.

Props adamsilverstein.
Fixes #37099.

git-svn-id: https://develop.svn.wordpress.org/trunk@37723 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 09:26:06 +00:00
Andrew Ozz
70afec2875 Media: properly refresh the position of the Plupload shim so it moves over the Select Files button or off the screen. Fixes selecting files in MS Edge on the Media grid and Media -> Add New screens.
Fixes #37039.

git-svn-id: https://develop.svn.wordpress.org/trunk@37722 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 04:53:42 +00:00
Boone Gorges
e1cfb25e79 Query: set_found_posts() must run immediately after main query.
If not run immediately after, the `SELECT FOUND_ROWS()` query might refer to
a different query, such as the one used to populate the post cache for a split
query.

Introduced in [37692].

Fixes #36687.

git-svn-id: https://develop.svn.wordpress.org/trunk@37721 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-16 02:00:02 +00:00
Sergey Biryukov
b1f3926bcb Embeds: In WP_oEmbed::get_provider() and WP_oEmbed::get_html(), parse the $args string to an array, as we treat it as an array later.
See #37071.

git-svn-id: https://develop.svn.wordpress.org/trunk@37720 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 18:51:32 +00:00
Sergey Biryukov
983d5c94e8 Plugins: Normalize WP_PLUGIN_DIR in the test added in [37332], otherwise it fails on Windows.
See #29154.

git-svn-id: https://develop.svn.wordpress.org/trunk@37719 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 18:30:32 +00:00
Sergey Biryukov
25a27bff7d I18N: Revert the test added in [37716], as it causes errors when running the full suite.
See #36790.

git-svn-id: https://develop.svn.wordpress.org/trunk@37718 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 18:04:31 +00:00
Sergey Biryukov
89304a579f I18N: Adjust the regex in wp_maybe_decline_date() to handle word boundaries correctly.
Props semil.
Fixes #36790.

git-svn-id: https://develop.svn.wordpress.org/trunk@37717 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 17:44:45 +00:00
Sergey Biryukov
6a5305e0b1 I18N: Add a unit test for wp_maybe_decline_date().
See #36790.

git-svn-id: https://develop.svn.wordpress.org/trunk@37716 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 17:40:23 +00:00
Konstantin Obenland
86af710a3d Twenty Ten: Revert pot changes after update test.
Introduced in [37714].



git-svn-id: https://develop.svn.wordpress.org/trunk@37715 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 16:45:27 +00:00
Konstantin Obenland
4dd1d9bef9 Update/Install: Shiny Updates v2.
Gone are the days of isolation and feelings of "meh", brought on by The Bleak Screen of Sadness. For a shiny knight has arrived to usher our plugins and themes along their arduous journey of installation, updates, and the inevitable fate of ultimate deletion.

Props swissspidy, adamsilverstein, mapk, afragen, ocean90, ryelle, j-falk, michael-arestad, melchoyce, DrewAPicture, AdamSoucie, ethitter, pento, dd32, kraftbj, Ipstenu, jorbin, afercia, stephdau, paulwilde, jipmoors, khag7, svovaf, jipmoors, obenland.
Fixes #22029, #25828, #31002, #31529, #31530, #31773, #33637, #35032.



git-svn-id: https://develop.svn.wordpress.org/trunk@37714 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 16:36:07 +00:00
Rachel Baker
1d115078eb Comments: Do not flag a comment as a duplicate if the comment_author_email is provided but not a match.
This reduces the strictness of the duplicate check a little, but does prevent false duplicates for emoji or +1 comments by authors with matching names. The current logic was introduced all the way back in [2894].

Fixes #37093.

git-svn-id: https://develop.svn.wordpress.org/trunk@37713 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 14:50:38 +00:00
Boone Gorges
ade41fc2cf Query: After [37692], don't skip set_found_posts() when no posts are found.
The 'found_posts' filter must continue to run for plugins manipulating post
results via filter.

Props dd32.
Fixes #36687.

git-svn-id: https://develop.svn.wordpress.org/trunk@37712 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 12:32:25 +00:00
Pascal Birchler
3c34040bf2 Fix tests after [37708].
See #36767.

git-svn-id: https://develop.svn.wordpress.org/trunk@37710 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 11:54:28 +00:00
Pascal Birchler
b2671c3880 Embeds: Improve performance when embedding a post from the current site.
When the post being embedded is from the same site, there's no reason to do an HTTP request for it. The data can be fetched directly using `get_oembed_response_data()`.

Fixes #36767 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@37708 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-15 11:22:52 +00:00
Sergey Biryukov
57d2c46591 Permalinks: Avoid a PHP notice in get_permalink() if default category is unavailable.
Props Presskopp.
Fixes #36529.

git-svn-id: https://develop.svn.wordpress.org/trunk@37707 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 23:11:33 +00:00
Sergey Biryukov
2e79b18178 Themes: Make default "read more" link more accessible.
Add an `aria-label` with the post title to make it available for screen readers.

Props Kau-Boy.
Fixes #36572.

git-svn-id: https://develop.svn.wordpress.org/trunk@37706 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 22:45:10 +00:00
Sergey Biryukov
661f5a477e After [37702], correct the expected result in test_size_format().
See #37037.

git-svn-id: https://develop.svn.wordpress.org/trunk@37705 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 22:12:35 +00:00
Sergey Biryukov
62733745df Text Changes: Simplify two strings in wp_password_change_notification().
Add translator comments.

Props ramiy.
See #35736.

git-svn-id: https://develop.svn.wordpress.org/trunk@37704 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 22:08:02 +00:00
Sergey Biryukov
45d7737eb2 I18N: Add context and translator comments to Back to %s strings.
Fixes #37095.

git-svn-id: https://develop.svn.wordpress.org/trunk@37703 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 21:50:57 +00:00
SergeyBiryukov
aea4c0d86a In size_format() and wp_convert_bytes_to_hr(), replace kB with KB for consistency with other units.
Props Presskopp, dashaluna.
Fixes #37037.

git-svn-id: https://develop.svn.wordpress.org/trunk@37702 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 21:40:02 +00:00
Weston Ruter
2e81613be8 Customize: Ensure MediaControl fetches the necessary attachment data for rendering when dynamically added via JS.
Fixes #36521.
Props TimothyBlynJacobs, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@37701 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 19:27:41 +00:00
Weston Ruter
f26ccf6fac Customize: Update server-sent setting validation notifications as changes are entered.
Send back setting validities with full refreshes and selective refreshes so that invalid settings can have notifications displayed immediately before attempting save, and so that these notifications can be cleared as soon as the input is corrected.

* Splits out JS logic for listing controls into separate methods  `wp.customize.Setting.prototype.findControls()` and `wp.customize.findControlsForSettings()`.
* Adds a `setting` property to the `data` on notifications added to controls that are synced from their settings.
* Adds `selective-refresh-setting-validities` message sent from preview to pane.
* Changes `WP_Customize_Manager::validate_setting_values()` to return when settings are valid as well as invalid.
* Adds `WP_Customize_Manager::prepare_setting_validity_for_js()`.
* Add setting validities to data exported to JS in Customizer Preview and in selective refresh responses.

Fixes #36944.


git-svn-id: https://develop.svn.wordpress.org/trunk@37700 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 19:16:54 +00:00
DrewAPicture
9decae327d Docs: Update the documentation for get_site() and the get_site filter following the removal of the $output parameter in [37652].
Props flixos90.
See #35791.


git-svn-id: https://develop.svn.wordpress.org/trunk@37699 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 18:13:03 +00:00
Sergey Biryukov
7ad5c50b12 I18N: In remove_accents(), add support for de_CH and de_CH_informal.
Props grapplerulrich.
Fixes #37076.

git-svn-id: https://develop.svn.wordpress.org/trunk@37698 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 17:43:27 +00:00
Sergey Biryukov
4eab8aab82 Users: wp_signon() expects an array as the $credentials argument, not a string.
If an empty string was passed, redeclare it as an empty array to avoid a warning and a fatal error in PHP 7.1.0 Alpha 1.

Props simonvik.
Fixes #37071.

git-svn-id: https://develop.svn.wordpress.org/trunk@37697 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 15:33:06 +00:00
Sergey Biryukov
1a8ca6a167 Taxonomy: Introduce a redirect_term_location filter to change the redirect on term editing.
This complements the `redirect_post_location` filter added in [12260].

Props alexvandervegt.
Fixes #36367.

git-svn-id: https://develop.svn.wordpress.org/trunk@37696 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 15:05:21 +00:00
John Blackbourn
50a3c1c368 Upgrade/Install: Skip certificate verification when upgrading a network's sites. This avoids issues with self-signed certificates or otherwise invalid certificates.
Fixes #36975


git-svn-id: https://develop.svn.wordpress.org/trunk@37695 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 07:42:49 +00:00
Ryan McCue
87b095dae9 HTTP API: Update Requests.
This introduces a minimum value of 1 second for timeouts passed to cURL.

Internally, cURL uses alarm() for interrupts, which accepts a second-resolution timeout. Any values lower than 1 second are instantly failed rather than being rounded upwards. While this makes the experience worse for those using asynchronous DNS lookups, there's no way to detect which DNS resolver is being used from PHP.

See #33055, #8923.


git-svn-id: https://develop.svn.wordpress.org/trunk@37694 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 05:29:58 +00:00
Rachel Baker
af48ea92de Administration: Set a defined line-height for number type inputs to fix display issue in Safari.
Fixes #37024.
Props joelwills, kraftbj.

git-svn-id: https://develop.svn.wordpress.org/trunk@37693 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 02:06:36 +00:00
Boone Gorges
becae4f492 Query: Allow plugins to supply post results instead of having WP_Query fetch them from the database.
Returning a non-null value from the new `posts_pre_query` filter will cause
`WP_Query` to skip its database query, so that posts data can be provided from
elsewhere. This is useful in cases where post data may be mirrored in a
separate location, such as an external search application.

Developers should note that the `WP_Query` properties generally used to
calculate pagination - specifically, `found_posts` and `max_num_pages`, which
are determined by default in `set_found_posts()` - must be provided explicitly
when using the `posts_pre_query` filter; since `WP_Query` will not be
contacting the database, it will have no access to `SELECT FOUND_ROWS()`.
The `WP_Query` instance is passed to `posts_pre_query` by reference, so that
these properties can be set manually if needed.

Props jpdavoutian, tlovett1.
Fixes #36687.

git-svn-id: https://develop.svn.wordpress.org/trunk@37692 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 01:59:25 +00:00
Boone Gorges
3132836080 Taxonomy: More specific cap check when processing category data on post save.
Props dlh.
Fixes #36379.

git-svn-id: https://develop.svn.wordpress.org/trunk@37691 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-14 01:36:59 +00:00
Aaron Jorbin
84a19f4a93 Bootstrap/Load. Adjust filters added in [37626].
These adjustments improve the documentation for the filters and adjust the names make them more consistent with other filters already in core.

See #34936.
Props DrewAPicture, ocean90, jorbin


git-svn-id: https://develop.svn.wordpress.org/trunk@37690 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-12 02:42:02 +00:00
Jeremy Felt
2b2dde968b Login: Fire wp_no_robots() in wp_die() only if function exists.
This covers cases where `wp_die()` is used before `general-template.php` is loaded.

Fixes #34401.


git-svn-id: https://develop.svn.wordpress.org/trunk@37689 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-12 00:33:27 +00:00
Drew Jaynes
034b6c025d Docs: Improve first-order clause documentation for the $meta_query parameter in the constructor for WP_Meta_Query.
First-order meta query clauses are defined as clauses that have either a 'key' or 'value' array key. When using named first-order clauses in meta queries to order results in the parent query, `WP_Meta_Query` can additionally accept first-order clauses at the sub-clause level, which was not previous documented.

Fixes #32659.


git-svn-id: https://develop.svn.wordpress.org/trunk@37688 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-12 00:01:54 +00:00
Dominik Schilling (ocean90)
0461e41927 Upgrade: Trigger the upgrader_process_complete action for translation updates.
This brings `Language_Pack_Upgrader` in line with the core, theme, and plugin upgrader.

Props ronalfy.
Fixes #36872.

git-svn-id: https://develop.svn.wordpress.org/trunk@37687 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 17:43:17 +00:00
Drew Jaynes
3348efa466 Docs: Improve the return description for wp_get_post_categories() to include more information about possible return values.
Props jeherve for the initial patch.
Fixes #37002.


git-svn-id: https://develop.svn.wordpress.org/trunk@37686 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 17:07:35 +00:00
Dominik Schilling (ocean90)
979660717e Canonical: Introduce wp_get_canonical_url().
`wp_get_canonical_url()` encapsulates the URL logic of `rel_canonical()` to provide a consistent way to retrieve the canonical URL for a post.
The new filter `get_canonical_url` allows to customize the canonical URL.

Props joostdevalk, jipmoors, DrewAPicture, ocean90.
Fixes #36168.

git-svn-id: https://develop.svn.wordpress.org/trunk@37685 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 13:30:23 +00:00
Andrew Ozz
e65a667c9c Editor: prevent jumping when using the backspace button in the Text editor in Firefox and IE.
Fixes #37072.

git-svn-id: https://develop.svn.wordpress.org/trunk@37684 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 05:14:18 +00:00
Boone Gorges
b9d46425c0 Introduce term_taxonomy_id parameter for WP_Term_Query.
Allows the fetching of terms based on `term_taxonomy_id`, or an array of
`term_taxonomy_ids`.

Props spacedmonkey.
Fixes #37074.

git-svn-id: https://develop.svn.wordpress.org/trunk@37683 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 03:48:03 +00:00
Boone Gorges
beebded867 Tests: Move WP_Tax_Query tests to a more appropriate file.
The file they were living in is the rightful home of `WP_Term_Query` tests.

See #37074.


git-svn-id: https://develop.svn.wordpress.org/trunk@37682 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-11 03:26:07 +00:00
Andrea Fercia
2aebf33f9d Plugin Install: fix edge-case where the tab=upload page can be accessed directly.
The `?tab=upload` page still exists for no-js support and for users who may
access it directly (e.g. from bookmarks or history) or plugins doing the same.
In this page, the "Browse plugins" link should always behave like a link.

Fixes #35429.

git-svn-id: https://develop.svn.wordpress.org/trunk@37681 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 22:38:57 +00:00
Andrea Fercia
18ef7d6225 Accessibility: Help text improvements.
Avoid references to "visual" positions in favour of positions in the document
structure. The help text shouldn't assume users can see.

Also, in the Posts screen don't mention specific types of posts and use a more
generic text instead.

Props odysseygate, pansotdev, zakb8.
Fixes #34761.

git-svn-id: https://develop.svn.wordpress.org/trunk@37680 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 21:42:05 +00:00
Andrea Fercia
a177094f56 Accessibility: Customizer, make the menu items "clear search results" a button.
For Web standards and accessibility, always prefer native controls instead of
`span` or `div` elements.

Fixes #36903.

git-svn-id: https://develop.svn.wordpress.org/trunk@37679 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 21:21:09 +00:00
Joe McGill
0d020faa68 Media: Fix rendering of incorrect toolbar in the Edit view.
This switches event binding in `wp.media.controller.EditImage` to use `on`
instead of `listenTo` to restore rendering of the correct toolbar when the
`toolbar:render:edit-image` event fires. The existing listeners broke
when we upgraded Backbone in [36546].

Props adamsilverstein.
Fixes #36861 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@37678 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 21:11:28 +00:00
Drew Jaynes
831a186108 Boostrap: Move is_ssl() to wp-includes/load.php.
Moving to load.php introduces parity with other commonly evaluated `is_*()` functions such as `is_admin()` or `is_multisite()`.  It also makes `is_ssl()` available much earlier in the loading process, such as for use in drop-ins like advanced-cache.php.

Props johnjamesjacoby.
Fixes #35844.


git-svn-id: https://develop.svn.wordpress.org/trunk@37677 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-10 18:55:33 +00:00