Commit Graph

36297 Commits

Author SHA1 Message Date
Andrew Ozz
7d34efea8d Improve wording of the AYS warning when permanently deleting uploads, tags, posts.
Props dllh, gma992.
Fixes #39712 for trunk.
Built from https://develop.svn.wordpress.org/trunk@40283


git-svn-id: http://core.svn.wordpress.org/trunk@40195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 19:33:43 +00:00
Sergey Biryukov
e9f73b06b6 Docs: Correct the description for wp.updates.deleteTheme.
Props MattyRob.
Fixes #40110.
Built from https://develop.svn.wordpress.org/trunk@40279


git-svn-id: http://core.svn.wordpress.org/trunk@40194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 16:13:46 +00:00
Boone Gorges
43208263a0 Tests: Use assertSame() for WP_Query 'orderby' tests.
`assertEqualSets()` ignores order, so isn't much good for testing 'orderby'.

See #38034.
Built from https://develop.svn.wordpress.org/trunk@40278


git-svn-id: http://core.svn.wordpress.org/trunk@40193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 03:08:48 +00:00
Boone Gorges
bdd898045d Don't run 'get_terms' filter when querying for terms within get_term_by().
Historically, it has been possible to call `get_term_by()` within
a 'get_terms' filter callback. Since `get_term_by()` was refactored
to use `get_terms()` internally [38677], callbacks of this nature
have resulted in infinite loops.

As a workaround, we introduce a 'suppress_filter' option to `get_terms()`,
and use it when calling the function from within `get_term_by()`.

Props ocean90.
See #21760.
Built from https://develop.svn.wordpress.org/trunk@40275


git-svn-id: http://core.svn.wordpress.org/trunk@40192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 02:27:44 +00:00
John Blackbourn
afdef17903 Build/Test tools: Don't install PHPUnit on the travis:js builds. Saves a couple of minutes of build time.
See #40100

Built from https://develop.svn.wordpress.org/trunk@40271


git-svn-id: http://core.svn.wordpress.org/trunk@40190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 23:57:44 +00:00
Sergey Biryukov
59855beb7b Twenty Seventeen: Correct grammar in 'Page Layout' control description.
Props zoonini, laurelfulford.
Fixes #40107.
Built from https://develop.svn.wordpress.org/trunk@40270


git-svn-id: http://core.svn.wordpress.org/trunk@40189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 23:35:45 +00:00
John Blackbourn
4b1de2bec0 Build/Test tools: Get Travis builds working on HHVM again.
This change moves to specifying the PHPUnit version for all PHP versions, and fixes an issue where the Composer global bin directory is not at `~/.composer/vendor/bin` on the boxes that are used for HHVM builds.

See #40100

Built from https://develop.svn.wordpress.org/trunk@40269


git-svn-id: http://core.svn.wordpress.org/trunk@40188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 22:58:44 +00:00
Andrea Fercia
6944c8f3a6 List Tables: After [38703], [38706], and [40118], adjust the jQuery selector to make the selection of a range of checkboxes work again.
Unprop afercia.
Fixes #40056.

Built from https://develop.svn.wordpress.org/trunk@40268


git-svn-id: http://core.svn.wordpress.org/trunk@40187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 19:14:46 +00:00
John Blackbourn
d675e30e51 Build/Test tools: Don't attempt to report PHP's extensions when running HHVM jobs on Travis. It doesn't work.
Built from https://develop.svn.wordpress.org/trunk@40267


git-svn-id: http://core.svn.wordpress.org/trunk@40186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 15:31:41 +00:00
John Blackbourn
96b2923e62 Docs: Remove the duplicate hook documentation for the newly introduced send_auth_cookies filter.
See #39367

Built from https://develop.svn.wordpress.org/trunk@40264


git-svn-id: http://core.svn.wordpress.org/trunk@40184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 15:03:42 +00:00
John Blackbourn
265a0f4d98 Build/Test tools: Don't override the wp_set_auth_cookie() and wp_clear_auth_cookie() functions.
Overriding pluggable functions in the test suite is asking for trouble in the future. In addition, it means the test suite can't be guaranteed to behave the same as core.

This instead introduces a `send_auth_cookies` filter which can be hooked in during the test suite to prevent these functions from attempting to send cookie headers to the client.

Fixes #39367

Built from https://develop.svn.wordpress.org/trunk@40263


git-svn-id: http://core.svn.wordpress.org/trunk@40183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 14:33:46 +00:00
John Blackbourn
129063036e Build/test tools: Add some more debugging to Travis and bring the format of the Xdebug fix inline with branches.
Built from https://develop.svn.wordpress.org/trunk@40259


git-svn-id: http://core.svn.wordpress.org/trunk@40181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 21:48:42 +00:00
Dominik Schilling
b2984d8b67 Build/Test Tools: On Travis CI install and use the node version which is specified in package.json.
Props netweb.
See #35105.
Built from https://develop.svn.wordpress.org/trunk@40258


git-svn-id: http://core.svn.wordpress.org/trunk@40180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 21:09:42 +00:00
John Blackbourn
b5a47a131c Build/Test tools: Account for PHP 5.2 when using Composer to install PHPUnit.
See #39822, #40086

Built from https://develop.svn.wordpress.org/trunk@40257


git-svn-id: http://core.svn.wordpress.org/trunk@40179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 20:54:43 +00:00
Sergey Biryukov
6476ef2cc9 Canonical: Strip trailing punctuation from permalinks.
Props joostdevalk, lancewillett, SergeyBiryukov.
Fixes #20383.
Built from https://develop.svn.wordpress.org/trunk@40256


git-svn-id: http://core.svn.wordpress.org/trunk@40178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 20:05:46 +00:00
John Blackbourn
f79e867a96 Build/Test tools: Explicitly use PHPUnit 5.7 for the PHP 7 builds on Travis.
This avoids fatal errors while the tests remain incompatible with PHPUnit 6, which was recently introduced on Travis.

See #39822, #40086

Built from https://develop.svn.wordpress.org/trunk@40255


git-svn-id: http://core.svn.wordpress.org/trunk@40177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 19:14:44 +00:00
Sergey Biryukov
e18640f4a7 Docs: Correct @return type for calendar_week_mod().
Props dingo_bastard.
Fixes #40077.
Built from https://develop.svn.wordpress.org/trunk@40254


git-svn-id: http://core.svn.wordpress.org/trunk@40176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 14:02:55 +00:00
John Blackbourn
a188b877d4 Build/Test tools: Remove the unnecessary clone of the twentysixteen repo.
This is no longer needed since #31550.

Fixes #40066

Built from https://develop.svn.wordpress.org/trunk@40252


git-svn-id: http://core.svn.wordpress.org/trunk@40174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 01:11:43 +00:00
Weston Ruter
d7cb2f7706 Customize: Show title input placeholders for widgets that have default titles when rendered.
Fixes #39909.
Props bor0, dlh, westonruter.

Built from https://develop.svn.wordpress.org/trunk@40251


git-svn-id: http://core.svn.wordpress.org/trunk@40173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 18:25:44 +00:00
John Blackbourn
3821ff74bc Build/Test tools: In Travis, skip some tests when not on trunk.
This skips time sensitive tests (copyright year and PHP/MySQL version requirements) when tests are run on branches on Travis.

Props netweb, jorbin

Fixes #39486

Built from https://develop.svn.wordpress.org/trunk@40241


git-svn-id: http://core.svn.wordpress.org/trunk@40171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 00:07:42 +00:00
John Blackbourn
4dffd5b82e Build/Test tools: Revert [40239] due to unrelated changes.
See #39486

Built from https://develop.svn.wordpress.org/trunk@40240


git-svn-id: http://core.svn.wordpress.org/trunk@40170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 00:05:42 +00:00
John Blackbourn
28055b9ff5 Build/Test tools: In Travis, skip some tests when not on trunk.
This skips time sensitive tests (copyright year and PHP/MySQL version requirements) when tests are run on branches on Travis.

Props netweb, jorbin
Fixes #39486

Built from https://develop.svn.wordpress.org/trunk@40239


git-svn-id: http://core.svn.wordpress.org/trunk@40169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 00:01:46 +00:00
James Nylen
27aa0664df REST API: Add gmt_offset and timezone_string to the base /wp-json response.
The site's current timezone offset is an important piece of information for any REST API client that needs to manipulate dates.  It has not been previously available.

Expose both the `gmt_offset` (the site's current offset from UTC in hours) and `timezone_string` (which also provides information about daylight savings time) via the "site info" endpoint (the base `/wp-json` response).

Also update the `wp-api-generated.js` fixture file with the changes to the default API responses.

Props sagarkbhatt.
Fixes #39854.

Built from https://develop.svn.wordpress.org/trunk@40238


git-svn-id: http://core.svn.wordpress.org/trunk@40168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 05:48:41 +00:00
James Nylen
6e72e293c2 WP_Query: Add missing tests for combinations of orderby and include parameters.
This commit adds some missing test cases for combinations of `orderby` and other parameters (`post_parent__in` and `post_name__in`).

Followup to [40056] for `orderby` and `post__in`.

The interaction of these parameters is perhaps counterintuitive because `orderby` does not affect the returned results.  This is overall probably the best design, and it's now better tested and documented.

Props fibonaccina.
See #39055.

Built from https://develop.svn.wordpress.org/trunk@40237


git-svn-id: http://core.svn.wordpress.org/trunk@40167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 05:27:44 +00:00
John Blackbourn
9e6d7eca00 Build/Test Tools: Call wp_head() and wp_footer() in the theme used during tests.
See #31550
Fixes #39988

Built from https://develop.svn.wordpress.org/trunk@40235


git-svn-id: http://core.svn.wordpress.org/trunk@40165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 01:34:43 +00:00
John Blackbourn
263831a72d Press This: Verify intent before fetching in-page resources using Press This.
Props vortfu

Built from https://develop.svn.wordpress.org/trunk@40195


git-svn-id: http://core.svn.wordpress.org/trunk@40134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:55:41 +00:00
Aaron Campbell
288cd46939 Strip control characters before validating redirect.
Built from https://develop.svn.wordpress.org/trunk@40183


git-svn-id: http://core.svn.wordpress.org/trunk@40122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:38:41 +00:00
John Blackbourn
9092fd01e1 Taxonomy: Correct the formatting of HTML entities when generating the screen reader text for tag removal.
Props adamsilverstein

Built from https://develop.svn.wordpress.org/trunk@40181


git-svn-id: http://core.svn.wordpress.org/trunk@40120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:14:41 +00:00
Aaron Campbell
4d80f8b3e1 Plugins: Add file check to plugin deletions.
Built from https://develop.svn.wordpress.org/trunk@40169


git-svn-id: http://core.svn.wordpress.org/trunk@40108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 12:55:41 +00:00
Dominik Schilling
419c8d97ce Embeds: URL encode YouTube video IDs for broader compatibility.
Built from https://develop.svn.wordpress.org/trunk@40160


git-svn-id: http://core.svn.wordpress.org/trunk@40099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 11:42:40 +00:00
Jeremy Felt
28f838ca3e Validate video and audio metadata.
Built from https://develop.svn.wordpress.org/trunk@40148


git-svn-id: http://core.svn.wordpress.org/trunk@40087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 08:01:43 +00:00
Boone Gorges
2282cd8cf1 Taxonomy: When querying terms, ensure $taxonomies is an array.
This avoids PHP notices that otherwise arise when no `taxonomy`
parameter is passed to `get_terms()` or `WP_Term_Query`.

Props dlh.
Fixes #39932.
Built from https://develop.svn.wordpress.org/trunk@40147


git-svn-id: http://core.svn.wordpress.org/trunk@40086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 03:02:43 +00:00
Boone Gorges
b6572af5d2 Taxonomy: Improve 'Parent' label when editing taxonomy terms.
Instead of the hardcoded 'Parent', use the `parent_item` label.

Props abrain, dlh.
Fixes #34545.
Built from https://develop.svn.wordpress.org/trunk@40146


git-svn-id: http://core.svn.wordpress.org/trunk@40085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 02:54:42 +00:00
Boone Gorges
ac6a3c76e4 Taxonomy: Take 'parent' into account when checking for terms with duplicate names.
Terms with duplicate names are not allowed at the same level of a
taxonomy hierarchy. The name lookup introduced in [34809] did not
properly account for the 'parent' parameter, with the result that
the duplicate-name restriction was tighter than intended (terms
with duplicate names could not be created at different levels of
a single hierarchy).

Props mikejolley.
Fixes #39984.
Built from https://develop.svn.wordpress.org/trunk@40145


git-svn-id: http://core.svn.wordpress.org/trunk@40084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 02:50:41 +00:00
Boone Gorges
5ac6ecab48 Taxonomy: Improve precision of duplicate name checks when inserting terms.
`wp_insert_term()` does not allow for terms with the same name to exist
at the same hierarchy level, unless the second term has a unique slug.
When this logic was refactored in [31792] and [34809], a bug was
introduced whereby it was possible to bypass the no-same-named-sibling
check in cases where the first term had a non-auto-generated slug
(ie, where the name was 'Foo' but the slug something other than 'foo',
such that the second term would get the non-matching slug 'foo').

This changeset fixes this issue by ensuring that the duplicate name
check runs both in cases where there's an actual slug clash *and* in
cases where no explicit `slug` has been provided to `wp_insert_term()`.
The result is a more reliable error condition:
`wp_insert_term( 'Foo' ... )` will always fail if there's a sibling
'Foo', regardless of the sibling's slug.

Props mikejolley.
See #39984.
Built from https://develop.svn.wordpress.org/trunk@40144


git-svn-id: http://core.svn.wordpress.org/trunk@40083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-03 02:40:45 +00:00
Dion Hulse
8fa6353267 Bump Akismet External to 3.3.
git-svn-id: http://core.svn.wordpress.org/trunk@40081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-02 03:14:56 +00:00
Boone Gorges
d29924e496 Improve formatting in wp_term_is_shared() docblock.
Props netweb.
Fixes #40004.
Built from https://develop.svn.wordpress.org/trunk@40143


git-svn-id: http://core.svn.wordpress.org/trunk@40080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-02 02:28:41 +00:00
Boone Gorges
04a7ef2b67 Tests: Starter content tests should use copies of images stored in /tmp.
This ensures that generated thumbnails are kept out of the version-
controlled `DIR_TESTDATA` directory.

Props bor0.
Fixes #40008.
Built from https://develop.svn.wordpress.org/trunk@40142


git-svn-id: http://core.svn.wordpress.org/trunk@40079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-02 02:26:44 +00:00
John Blackbourn
ae890935b3 Build/Test Tools: Only attempt to disable Xdebug on stable builds of PHP.
Unstable builds of PHP (nightly and hhvm) don't have the Xdebug extension enabled. Attempting to disable it results in a build error.

See #39978

Built from https://develop.svn.wordpress.org/trunk@40139


git-svn-id: http://core.svn.wordpress.org/trunk@40076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-28 00:04:44 +00:00
John Blackbourn
6a578af528 Build/Test Tools: Disable Xdebug when testing on Travis.
This should have some performance benefits, but I guess we'll need to wait and see.

See #39978

Built from https://develop.svn.wordpress.org/trunk@40138


git-svn-id: http://core.svn.wordpress.org/trunk@40075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 22:54:43 +00:00
Joe McGill
f8c7aa6208 Media: Skip PDF preview tests when image editor doens't support.
Following [40130] tests fail on environments that don't support PDF
previews because the expected meta data doesn't get written.

See #39875.
Built from https://develop.svn.wordpress.org/trunk@40131


git-svn-id: http://core.svn.wordpress.org/trunk@40068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 17:51:45 +00:00
Joe McGill
d6bec79fe7 Media: Keep PDF previews from overwriting files.
Since support for PDF previews were added in [38949], it's possible
that the generated image file could overwrite an existing image file
with the same name. This uses `wp_unique_filename()` to avoid this
issue and adds a '-pdf' identifier on the end of filenames.

Props gitlost, derosj, mikeschroder, joemcgill.
Fixes #39875. See #31050.
Built from https://develop.svn.wordpress.org/trunk@40130


git-svn-id: http://core.svn.wordpress.org/trunk@40067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 15:39:47 +00:00
Mike Schroder
f780259d88 Media: After [40123], Feature check setImageOrientation.
In [40123], `WP_Image_Editor_Imagick` started using
`Imagick::setImageOrientation` and `Imagick::ORIENTATION_TOPLEFT`,
but had no equivalent feature check.

While they were introduced more than 9 years ago, it's important
to double-check everything is available before using with Imagick.

Fixes #37140.
Built from https://develop.svn.wordpress.org/trunk@40129


git-svn-id: http://core.svn.wordpress.org/trunk@40066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 04:22:51 +00:00
John Blackbourn
76f44d242b Comments: When commenting on a draft post, display a friendly error message if the user can view the post.
This prevents the unhelpful white screen of death when a user who can view the post (eg. preview it) leaves a comment while the post is in draft.

Props sagarprajapati, milindmore22, mayurk, swissspidy
Fixes #39650

Built from https://develop.svn.wordpress.org/trunk@40128


git-svn-id: http://core.svn.wordpress.org/trunk@40065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 00:23:40 +00:00
John Blackbourn
9e095f0791 Mail: Ensure entities in the site title are decoded when used in the body of the new user email.
Props ajoah
Fixes #39446

Built from https://develop.svn.wordpress.org/trunk@40127


git-svn-id: http://core.svn.wordpress.org/trunk@40064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-26 22:20:44 +00:00
Andrea Fercia
c3a2b57241 Media: Restore correct upload errors displaying after [37610].
Props codegeass, MatheusGimenez, joemcgill.
Fixes #39516.

Built from https://develop.svn.wordpress.org/trunk@40126


git-svn-id: http://core.svn.wordpress.org/trunk@40063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-26 18:15:43 +00:00
Joe McGill
8e56992132 Media: Fix unit tests for MIME checks on multisite.
A few of the multisite tests were failing after [40124] because
multisite filters `upload_mimes` with the `check_upload_mimes()`
function to reduce the set of allowed MIME types. This fixes those
errors by skipping the tests for adding additional MIME types and
only tests file types assumed to be allowed.

See #39550.
Built from https://develop.svn.wordpress.org/trunk@40125


git-svn-id: http://core.svn.wordpress.org/trunk@40062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-26 16:06:45 +00:00
Joe McGill
87ad9e31ab Media: Reduce failing uploads following 4.7.1.
[39831] introduced more strict MIME type checking for uploads, which
resulted in unintetionally blocking several filetypes that were
previously valid. This change uses  a more targeted approach to MIME
validation to restore previous behavior for most types.

Props blobfolio, iandunn, ipstenu, markoheijnen, xknown, joemcgill.
Fixes #39550, #39552.
Built from https://develop.svn.wordpress.org/trunk@40124


git-svn-id: http://core.svn.wordpress.org/trunk@40061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 16:08:44 +00:00
Mike Schroder
454acad22e Media: Reset Exif orientation after rotate in WP_Image_Editor_Imagick.
Due to inconsistencies in the way browsers handle Exif orientation data,
if a user manually rotates an image within WordPress, set the Exif orientation to
the default (1) so that the image displays with the same rotation/flip in every browser.

Props sanchothefat, triplejumper12, joemcgill, azaozz, markoheijnen, mikeschroder.
See #14459.
Fixes #37140.
Built from https://develop.svn.wordpress.org/trunk@40123


git-svn-id: http://core.svn.wordpress.org/trunk@40060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 05:26:41 +00:00
James Nylen
0c005fdb0e REST API: Fix behavior of sticky posts filter when no posts are sticky.
Previously, when getting posts from the API with `sticky=true`, if there were no sticky posts set, the query would return all posts  as if the `sticky` argument was not set.  In this situation, the query should return an empty array instead.

A `sticky=true` query that should return an empty array (in the previous situation, or with `include` and no intersecting post IDs) was also broken in that it would query the post with ID 1.

Finally, this commit significantly improves test coverage for the `sticky` filter argument, including direct testing of the `WHERE` clauses generated by `WP_Query`.

Props ryelle.
Fixes #39947.

Built from https://develop.svn.wordpress.org/trunk@40122


git-svn-id: http://core.svn.wordpress.org/trunk@40059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-25 05:03:42 +00:00