1426 Commits

Author SHA1 Message Date
Joe McGill
ccd5d3e540 Media: Improve handling of extensionless filenames.
Merge of [37756] to the 4.4 branch.

See #37111.

git-svn-id: https://develop.svn.wordpress.org/branches/4.4@37810 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:51:38 +00:00
Pascal Birchler
2d2185bf76 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()`.

Merge of [37708], [37710] and [37729] to the 4.4 branch.

Fixes #36767.

git-svn-id: https://develop.svn.wordpress.org/branches/4.4@37798 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-21 14:41:05 +00:00
Boone Gorges
2aa2ea5249 Revert [37642].
Was mistakenly committed to the 4.4 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@37643 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 21:16:54 +00:00
Boone Gorges
cba33d06f3 Tests: Move wp_set_object_terms() tests to their own file.
See #37009.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@37642 602fd350-edb4-49c9-b593-d223f7449a82
2016-06-06 21:08:23 +00:00
Aaron Jorbin
5ee244e909 Adjust unit tests to account for change in [37145].
Merges [37150] to 4.4 branch


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@37151 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-30 19:53:40 +00:00
Pascal Birchler
56ebd53549 Embeds: Improve how iframes are loaded after being initially hidden.
Use a more accessible way to initially hide the iframe. After that, only display an iframe when it was successfully loaded.

Merge of [36648] and [36708] to the 4.4 branch.

Fixes #35894.

git-svn-id: https://develop.svn.wordpress.org/branches/4.4@37093 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-30 10:56:44 +00:00
Boone Gorges
6e4269761d Query: Ignore search terms consisting of a single dash.
Due to the "exclude" support added in WP 4.4, single dashes were being
converted to "NOT LIKE '%%'" clauses, causing all searches to fail.

Ports [36989] to the 4.4 branch.

Props RomSocial, swissspidy.
Fixes #36195.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@37082 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-25 18:40:27 +00:00
Dominik Schilling (ocean90)
9d1455b89b Better validation of the URL used in HTTP redirects.
Merges [36444] to the 4.4 branch.

git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36447 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-02 16:58:49 +00:00
Dion Hulse
efa391dea7 Customizer: Prevent erroneously directing user to login screen when closing.
Fixes issue where user gets stuck at login screen after trying to close the app if previously they had to first login to access the Customizer. Prevents `WP_Customize_Manager::get_return_url()` from using `wp-login.php` as a referer.

Merges [36261] to the 4.4 branch.
Props chandrapatel.
See #32637.
Fixes #35355.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36363 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 08:36:17 +00:00
Dion Hulse
92f2281f6f Comments: Ignore hierarchy in pagination calculation when comment threading is disabled.
In order to calculate comment pagination when newest comments are displayed
first, `comments_template()` must perform a separate query to determine the
total number of paginating comments available on a post. See [34729], #8071,
pagination calculation - can be defined as a top-level comment, or a comment
with `parent=0`. However, when comment threading is disabled, yet comments
exist in the database that have parents, all comments - even those with a
parent - are "paginating". (This typically happens when comments threading was
once enabled, but has since been turned off.) As such, the total-paginating-
comments query should only be limited to top-level comments when
'thread_comments' is disabled.

Merges [36275] to the 4.4 branch.
Props jmdodd.
Fixes #35419.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36362 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 08:32:00 +00:00
Dion Hulse
bd88063512 Comments: Respect all post-related filters in WP_Comment_Query.
The refactor of `WP_Comment_Query`'s SQL generation in [34542] introduced a bug
that caused only the last post-related filter to be respected in comment
queries. In other words, if querying for comments using params
`post_status=draft&post_author=3`, only the last-processed of these params
would be respected. The current changeset fixes the logic so that these clauses
don't overwrite each other.

Merges [36326] to the 4.4 branch.
Props chriscct7.
Fixes #35478.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36361 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 08:01:55 +00:00
Dion Hulse
c3e627cec3 Taxonomy: Populate term cache with proper clone of term objects.
[34999] modified the cache strategy for terms in the context of
`wp_get_object_terms()`. As part of these changes, the `object_id` property of
term objects had to be unset before being cached. To avoid modifying passed-by-
reference terms, `update_term_cache()` attempted to make a copy of the terms
passed to the function; however, it failed to use the `clone` keyword, and thus
only created a reference instead of a copy.

Merges [36323] to the 4.4 branch.
Props berengerzyla.
Fixes #35462.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36358 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 05:34:30 +00:00
Dion Hulse
b4554835dd Comments: Use the post-filter WHERE clause when querying for comment descendants.
The descendant query in `WP_Comment_Query::fill_descendants()` uses the clauses
of the main `get_comment_ids()` query as a basis, discarding the `parent`,
`parent__in`, and `parent__not_in` clauses. As implemented in WP 4.4 [34546],
the WHERE clause was assembled in such a way that any modifications applied
using the `comments_clauses` filter were not inherited by `fill_descendants()`.
This resulted in descendant queries that did not always properly filter
results, and sometimes contained syntax errors.

The current changeset fixes the problem by using the post-filter WHERE clause
as the basis for the `fill_descendants()` query. This change requires a new
approach for eliminating the unneeded parent-related clauses: instead of
eliminating values in an associative array, we must use regular expressions.

Merges [36277] to the 4.4 branch.
Props boonebgorges, firebird75.
Fixes #35192.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36357 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 05:27:07 +00:00
Dion Hulse
eae3e61822 Comments: Always respect $comments array passed to wp_list_comments().
[36157] fixed a bug whereby `wp_list_comments()` would not properly recognize
custom pagination arguments. See #35175. However, it inadvertently introduced
a bug that caused any `$comments` array explicitly passed to the function to be
ignored, when that array was accompanied by pagination arguments that differ
from those in `$wp_query`. We address this bug by moving the logic introduced
in [36157] inside a block that only fires when no `$comments` array has been
provided to the function.

Merges [36276] to the 4.4 branch.
Props ivankristianto, boonebgorges.
Fixes #35356.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36356 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 05:23:02 +00:00
Dion Hulse
bbaa6b6f71 Query: Avoid invalid SQL when building ORDER BY clause using long search strings.
The introduction of negative search terms in 4.4 [34934] introduced the
possibility that the ORDER BY clause of a search query could be assembled in
such a way as to create invalid syntax. The current changeset fixes this by
ensuring that the ORDER BY clause corresponding to the search terms is
excluded when it would otherwise be empty.

Merges [36251] to the 4.4 branch.
Props salvoaranzulla, boonebgorges.
Fixes #35361.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36354 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 04:37:13 +00:00
Dion Hulse
4de2825d77 Comments: In comments_template(), don't run hierarchical queries if comment threading is disabled.
When hierarchical=true, WP_Comment_Query will always fetch comments according to the comment hierarchy, even if 'thread_comments' is disabled for the site.
This can cause problems when comment threading is disabled after threaded comments have been recorded on the site; comments will no longer be returned in a strictly chronological order.
We address the issue by refraining from querying hierarchically when comment threading is disabled.

Merges [36226] to the 4.4 branch.
Props jmdodd.
Fixes #35378.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36353 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-20 04:32:22 +00:00
Dion Hulse
d84b9f21f6 Canonical / Query: After [36280] remove the unit tests which are no longer supported for 4.4.
This also removes the `is_feed()` code to avoid confusion - only pages & embeds will be redirected.
See #35344


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36281 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 08:48:14 +00:00
Konstantin Obenland
513f8b27ee Template: Always display the site title on the front page.
Limits using the page title to the blog page when the site has a static front page,
bringing it N’Sync with `wp_title()`.

Merges [36168] to the 4.4 branch.

Props peterwilsoncc.
Fixes #34962.



git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36169 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-04 17:18:30 +00:00
Andrew Nacin
7b7656950e XML-RPC: Revert [34681] as it broke date handling.
Merges [36163] to the 4.4 branch.

props dossy, hnle, redsweater.
see #35053, #30429 (original ticket).


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36164 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-03 19:49:34 +00:00
Boone Gorges
361b83bf86 Ensure that non-default pagination values work in wp_list_comments().
Prior to 4.4, it was possible to pass 'page' and 'per_page' values to
`wp_list_comments()` that do not match the corresponding global query vars.
This ability was lost in 4.4 with the refactor of how `comments_template()`
queries for comments; when the main comment query started fetching only the
comments that ought to appear on a page, instead of all of a post's comments,
it became impossible for the comment walker to select comments corresponding to
custom pagination parameters. See #8071.

We restore the previous behavior by (a) detecting when a 'page' or 'per_page'
parameter has been passed to `wp_list_comments()` that does not match the
corresponding query vars (so that the desired comments will not be found in
`$wp_query`), and if so, then (b) querying for all of the post's comments and
passing them to the comment walker for pagination, as was the case before 4.4.

Merges [36157] to the 4.4 branch.

Props boonebgorges, smerriman.
Fixes #35175.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36158 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-03 02:06:04 +00:00
Dion Hulse
60d47bc0e0 Responsive images: fix the check whether the attachment meta matches the image src to work with http/https and CDNs.
Merges [36121] to the 4.4 branch.
Props webaware, joemcgill, azaozz.
Fixes #35045 and #35102.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36152 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-02 03:55:47 +00:00
Dion Hulse
fae8680ea6 Responsive images: add compatibility for versions < 2.7 when the full image path was stored in the metadata. Introduces _wp_get_attachment_relative_path() and uses it in wp_get_attachment_url().
Merges [36120] to the 4.4 branch.
Props dd32, SergeyBiryukov.
Fixes #35106.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36151 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-02 03:53:21 +00:00
Dion Hulse
750a86d2f9 Responsive Images: when creating srcset do not exclude the image size which is in the src attribute even when it is larger than max_srcset_image_width.
Merges [36110] to the 4.4 branch.
Props joemcgill.
Fixes #35108.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36150 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-02 03:52:01 +00:00
Dion Hulse
2b6f78b8e9 Widgets: Revert [34465], as it introduced a regression, making the $index argument of dynamic_sidebar() case-sensitive.
Merges [36130] to the 4.4 branch.
See #23423.
Fixes #34995.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36148 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-02 03:38:45 +00:00
Dion Hulse
462b6016b7 Comments: Ensure only approved comments trigger post author notifications
Posts that are trashed shouldn't trigger post author notifications. Adds unit tests to enforce this.

Merges [36119] to the 4.4 branch.
Props scottbrownconsulting, peterwilsoncc, swissspidy.
Fixes #35006.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36146 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-02 03:34:35 +00:00
Gary Pendergast
68f621f76a Redirects: Prevent redirects if a queried object exists.
After [34659], it became possible to cause an incorrect redirect, by changing the slug of a post, then creating a new post with the old slug. The correct behaviour is to prevent redirecting to the old post.

Props dd32, pento.

Merge of [36128] to the 4.4 branch.

Fixes #35031.



git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36129 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-31 03:08:28 +00:00
Dion Hulse
2e6fd7f2f1 Tests: After [36100] use an object style which is compatible with PHP5 get_object_vars().
Merges [36117] to the 4.4 branch.
See #35249.
Fixes #35058.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36118 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-29 05:48:58 +00:00
Boone Gorges
b1e92818a8 Force non-public taxonomies to have a query_var of false.
[35333] implemented `public=false` for taxonomies. The implementation prevented
non-public taxonomies from having their archives accessed via query_var during
a normal request. But it didn't prevent non-public taxonomies from registering
their query vars in the `$wp_taxonomies` global. The latter implementation
details causes problems specifically when a taxonomy is registered with
`query_var=true`; for public taxonomies, `register_taxonomy()` translates this
into a query_var equivalent to the taxonomy name, but in the case of non-public
taxonomies, the query_var was set to the boolean itself. The boolean then
causes problems when using non-strict comparison to filter taxonomy objects by
query_var, as when using `get_taxonomies()`.

This changeset addresses the issue by forcing the query_var property of
non-public taxonomies to `false`.

Merges [36108] to the 4.4 branch.

Fixes #35089.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36109 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-27 16:42:35 +00:00
Dion Hulse
5310dbb071 Pages: get_page_uri() should return the URI at which the resource being accessed is available at, this may include non-'publish' status posts.
Reverts [34001] and fixes the original issue in #15963 - avoiding a PHP Notice for when the post doesn't exist.

Merges [36094] to the 4.4 branch.
Props tharsheblows.
See #15963.
Fixes #35084.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36105 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-27 02:15:30 +00:00
Dion Hulse
0c2d4a35db Help Tab Order should be based on the Priority Argument
[34370] made the order that tabs are returned respect the order they are added, however it broke the respect of priority. By using a ksort instead of a sort, we can restore that default behavior. This adjusts the unit tests so that both order added and priority are tested.

Merges [36089] to the 4.4 branch.
Props meitar, swissspidy, jorbin
Fixes #35215. See #33941.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36104 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-27 02:13:20 +00:00
Dion Hulse
89743282f7 Allow map_deep() to work with object properties containing a reference. Restores the previous behaviour of stripslashes_deep().
Merges [36100] to the 4.4 branch.
Props jeff@pyebrook.com, swissspidy.
See #22300, [35252].
Fixes #35058.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36101 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-26 05:23:43 +00:00
Dion Hulse
0ad7833b73 Shortcodes: = is a reserved character in shortcode names, mark it as such.
This allows for shortcodes such as `[shortcode=attribute]` to work, which while never intentionally supported were widely used in the pre-shortcode days.

Merges [36097] to the 4.4 branch, minus a string change.
Props aaroncampbell.
Fixes #34939.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36098 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-26 04:47:58 +00:00
Gary Pendergast
f605394d46 Embeds: Don't show embed discovery link on a static front page.
There's currently no iframe content being generated for a static front page. Giving out a link to that isn't an ideal user experience.

Props peterwilsoncc.

Merge of [36059] to the 4.4 branch.

Fixes #35194.



git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36060 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-22 10:54:17 +00:00
Boone Gorges
9b064872d0 Order terms by 'name' when populating object term cache.
[34217] removed the `ORDER BY` clause from `update_object_term_cache()`, for
improved performance. But this proved to cause problems in cases where users
were expecting the results of `get_the_terms()` to be ordered by 'name'. Let's
revert the change for the time being, and look into more disciplined ordering
in a future release.

Merges [36056] to the 4.4 branch.

Props afercia.
See #28922. Fixes #35180.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36057 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-22 01:52:41 +00:00
John Blackbourn
509f2dc5f7 Tests: Correct the public query vars test for the 4.4 branch.
See #35115


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36052 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-21 08:35:15 +00:00
John Blackbourn
58dbd83c4f Query: Re-initialise any dynamically-added public query vars before running the public query vars test.
Merges [36048] to the 4.4 branch.

Fixes #35115


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36051 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-21 07:56:05 +00:00
John Blackbourn
5f07f529a7 Query: Introduce a unit test which will fail when new public query vars are introduced without also updating the test. This adds an extra layer of explicitness to introducing public query vars in order to avoid introducing unintentional clashes with URL query vars that are already in use.
Merges [36045] to the 4.4 branch.

Fixes #35115


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36046 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-21 05:49:42 +00:00
Boone Gorges
6049f6f119 Respect approval status when determining comment page count in comments_template().
Since 4.4, when fetching the first page of comments and the 'newest' comments
are set to display first, `comments_template()` must perform arithmetic to
determine which comments to show. See #8071. This arithmetic requires the
total comment count for the current post, which is calculated with a separate
`WP_Comment_Query`. This secondary comment query did not properly account for
non-approved comment statuses; all unapproved comments should be part of the
comment count for admins, and individual users should have their own
unapproved comments included in the count. As a result, `comments_template()`
was, in some cases, being fooled into thinking that a post had fewer comments
available for pagination than it actually had, which resulted in empty pages
of comments.

We correct this problem by mirroring 'status' and 'include_unapproved' params
of the main comment query within the secondary query used to calculate pagination.

Merges [36040] to the 4.4 branch.

Fixes #35068.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36041 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-21 03:10:45 +00:00
John Blackbourn
f2c9b567d9 Comments: When a comment is submitted, ensure the user_ID element in the array that's passed to the preprocess_comment filter gets populated.
Merges [36038] to the 4.4 branch.

Fixes #34997


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36039 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-21 02:57:06 +00:00
Gary Pendergast
5cb6bf82b8 Texturize: Transform & into &#038; in tag attributes.
[35709] was overly broad, and stopped transforming `&` characters within tag attributes. So that sites aren't generating invalid HTML, we need to restore this functionality, while continuing to not transform `&` within blocked tags.

Merge of [36036] to the 4.4 branch.

Fixes #35008.



git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36037 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-21 02:45:43 +00:00
Boone Gorges
4407a710ce Ensure that wp_list_categories() supports comma-separated lists for 'exclude' and 'exclude_tree'.
[34696] introduced a regression whereby comma-separated values for 'exclude'
and 'exclude_tree' would be handled improperly when merging the two parameters,
resulting in category IDs being incorrectly dropped from the combined array.

Merges [36005] to the 4.4 branch.

Props gblsm, hnle.
Fixes #35156.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36006 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-18 18:13:58 +00:00
Boone Gorges
5d63b53a27 Ensure get_terms() results are unique when using 'meta_query'.
The introduction of 'meta_query' to `get_terms()` in 4.4 made it possible for
`get_terms()` to erroneously return duplicate results. To address the issue,
we add the `DISTINCT` keyword to the SQL query when a 'meta_query' parameter
has been provided.

Merges [36003] to the 4.4 branch.

Props @jadpm.
Fixes #35137.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36004 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-18 17:48:33 +00:00
Boone Gorges
d0d7a534b6 After [35934], ensure get_comment_link() test works without shared fixtures.
`get_comment_link()` test fixtures are shared in trunk as of [35857]. This
change was not backported to the 4.4 branch, so the 4.4 test should not
expect shared fixtures.

See #34946.

git-svn-id: https://develop.svn.wordpress.org/branches/4.4@35936 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-14 21:09:52 +00:00
Boone Gorges
4260a85f41 Omit cpage query var in comment link if comment pagination is disabled.
WP 4.4 changed the way comment pagination is calculated. See #8071. In the
context of `get_comment_link()`, these changes introduced a regression that
causes `cpage` (or its pretty-permalink correlate `comment-page-x`) to appear
in comment links when comment pagination is disabled. The current changeset
fixes the regression.

Merges [35933] to the 4.4 branch.

Fixes #34946.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@35934 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-14 19:56:14 +00:00
Boone Gorges
1045482f57 Improve handling for WP_Error objects in get_the_terms().
`wp_get_object_terms()` can return a `WP_Error` object. As such, the
`get_the_terms()` cache wrapper should handle them properly. To wit:

* Don't try to map an error object to `get_term()`. Introduced in [35032].
* Don't cache an error object as taxonomy relationships. Introduced in at least [16487], maybe earlier.

Ports [35850] to the 4.4 branch.

Props stephenharris.
Fixes #34723.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@35851 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-10 03:43:50 +00:00
Dominik Schilling (ocean90)
32860dbdf4 Media: Don't generate responsive image attributes if src does not match ID in wp-image- class.
We rely on the `wp-image-` class to quickly find an attachment ID to add responsive image attributes.
To avoid incorrect images being displayed, do not add these attributes if the `src` does not match the
meta from the attachment ID in the class.

Merge of [35820] to the 4.4 branch.

Props azaozz, kovshenin, joemcgill, mikeschroder.
See #34898.

git-svn-id: https://develop.svn.wordpress.org/branches/4.4@35821 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-07 20:28:37 +00:00
Scott Taylor
f89c25a43d REST API: Core typically sends nocache headers on all auth'ed responses, as in wp, admin-ajax, etc. Because the REST API infrastructure is hooked in pre-wp, we should be setting this ourselves.
Adds unit tests.

Props joehoyle.
Fixes #34832.


git-svn-id: https://develop.svn.wordpress.org/trunk@35773 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-04 23:35:54 +00:00
Boone Gorges
a1f89f4e86 Use 'invalid_username' error code when tripping 'illegal_user_logins'.
This gives us better compatibility with existing errors thrown by
`sanitize_user()`, especially in Multisite, where user_login has more
restrictions on allowed characters.

Props markjaquith.
Fixes #27317.

git-svn-id: https://develop.svn.wordpress.org/trunk@35772 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-04 23:24:56 +00:00
Dominik Schilling (ocean90)
ec01033a2d Unit Tests: Implement addWarning() method in SpeedTrapListener.
The method was introduced in PHPUnit 5.1.0, released today.

Fixes #34846.

git-svn-id: https://develop.svn.wordpress.org/trunk@35767 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-04 16:40:10 +00:00
Andrew Nacin
12b1cc4410 Embeds: Enforce, via unit tests, the no-ampersand rule for wp-embed.js.
fixes #34698.


git-svn-id: https://develop.svn.wordpress.org/trunk@35762 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-04 05:45:29 +00:00