1413 Commits

Author SHA1 Message Date
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
Mark Jaquith
2ddab3adf8 Route HEAD API requests through the GET callback method
fixes #34837
props danielbachhuber

git-svn-id: https://develop.svn.wordpress.org/trunk@35758 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-03 16:34:00 +00:00
Scott Taylor
aad857409b Customize Unit Tests: also remove_action( 'after_setup_theme', 'twentysixteen_setup' ). TwentyFifteen is already removed.
See #31550.


git-svn-id: https://develop.svn.wordpress.org/trunk@35754 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-01 20:55:22 +00:00
Scott Taylor
69900349ca Media: don't use get_media_embedded_in_content() in wp_make_content_images_responsive().
Adds unit test.

Props azaozz.
Fixes #34807.


git-svn-id: https://develop.svn.wordpress.org/trunk@35753 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-01 20:49:13 +00:00
Scott Taylor
c8b7126cbf Unit Tests: fix responsive image unit tests. Correct the logic in video shortcode unit test for width.
Props joemcgill, wonderboymusic.
Fixes #34790.


git-svn-id: https://develop.svn.wordpress.org/trunk@35751 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-01 20:44:54 +00:00
John Blackbourn
da2acf666a When a post is scheduled for publication, treat it the same as a published post when calculating the capabilities required to edit or delete it.
Fixes #33694


git-svn-id: https://develop.svn.wordpress.org/trunk@35747 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-29 02:24:15 +00:00
John Blackbourn
a8ea7d98b5 Ensure the correct error message is returned when a user attempts to comment on a post to which they do not have access.
Adds more tests.


git-svn-id: https://develop.svn.wordpress.org/trunk@35745 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-28 18:28:54 +00:00
Scott Taylor
663b7f28ff Upgrade: New themes are not automatically installed on upgrade. This can still be explicitly asked for by defining CORE_UPGRADE_SKIP_NEW_BUNDLED as false.
In `populate_options()`, if the theme specified by `WP_DEFAULT_THEME` doesn't exist, fall back to the latest core default theme. If we can't find a core default theme, `WP_DEFAULT_THEME` is the best we can do. 

Props nacin, jeremyfelt, dd32.
See #34306.


git-svn-id: https://develop.svn.wordpress.org/trunk@35738 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-25 21:44:02 +00:00
Scott Taylor
dc167a20e5 Add a unit test for wp_nav_menu() with container => ''
See #32464.



git-svn-id: https://develop.svn.wordpress.org/trunk@35736 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-25 18:18:37 +00:00
Dominik Schilling (ocean90)
d1ec5b6ac3 Passwords: Support the pre-4.3 behavior of wp_new_user_notification().
Hello, it's me again. A pluggable function named `wp_new_user_notification()`. A few months ago, after [33023], I have lost my second parameter `$plaintext_pass`. But thanks to [33620] I got a new one.
Bad idea - It hasn't had the same behavior as my previous parameter.
To solve that the second parameter got deprecated and reintroduced as the third parameter in [34116]. I was happy again, for a short time.
You remember my lost friend `$plaintext_pass`? No? Well, if its value was empty no notification was sent to the user. This behavior was still lost. And that's what this change is about: Don't notify a user if a plugin uses `wp_new_user_notification( $user_id )`.

You're asking if I'm happy now? Dunno, but maybe you have learned something about pluggable functions, have you?

Props danielbachhuber.
Fixes #34377.

git-svn-id: https://develop.svn.wordpress.org/trunk@35735 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-24 23:06:03 +00:00
Dominik Schilling (ocean90)
50c47fa78c HTTP Tests: Use login.wordpress.org/wp-login.php in test_get_response_cookies().
The old URL redirects to `login.wordpress.org` because it's the new canonical URL for all logins on wordpress.org.

Fixes #34782.

git-svn-id: https://develop.svn.wordpress.org/trunk@35734 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-24 21:59:23 +00:00
Sergey Biryukov
6f310a775d Users: Move the tests added in [35116] and [35618] to a more appropriate place and give them a better name.
See #28435, #29880.

git-svn-id: https://develop.svn.wordpress.org/trunk@35732 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-23 18:39:20 +00:00
Weston Ruter
89f49aad80 Customize: Ensure that a setting (especially a multidimensional one) can still be previewed when the post value to preview is set after preview() is invoked.
* Introduce `customize_post_value_set_{$setting_id}` and `customize_post_value_set` actions which are done when `WP_Customize_Manager::set_post_value()` is called.
* Clear the `preview_applied` flag for aggregated multidimensional settings when a post value is set. This ensures the new value is used instead of a previously-cached previewed value.
* Move `$is_preview` property from subclasses to `WP_Customize_Setting` parent class.
* Deferred preview: Ensure that when `preview()` short-circuits due to not being applicable that it will be called again later when the post value is set.
* Populate post value for updated-widget with the (unsanitized) JS-value in `WP_Customize_Widgets::call_widget_update()` so that value will be properly sanitized when accessed in `WP_Customize_Manager::post_value()`.

Includes unit tests with assertions to check the reported issues and validate the fixes.

Fixes defect introduced in [35007].
See #32103.
Fixes #34738.


git-svn-id: https://develop.svn.wordpress.org/trunk@35724 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-21 02:51:57 +00:00
Gary Pendergast
274bb41c04 Texturize: Only convert & to &#038; within text nodes.
Previously, `&` would be converted everywhere, which caused problems when it was converted within a `<script>`, for example.

`convert_chars()` is now removed from the `the_content` filter, as it was doing the same job as `wptexturize()`.

KSES correctly handles converting `&` within HTML attributes, so there's no need for `wptexturize()` and `convert_chars()` to do the same job.

Fixes #34698.



git-svn-id: https://develop.svn.wordpress.org/trunk@35709 602fd350-edb4-49c9-b593-d223f7449a82
2015-11-19 23:31:00 +00:00