Commit Graph

36595 Commits

Author SHA1 Message Date
Sergey Biryukov 43a27ede8f Docs: Add description for `$mode` global in `WP_Media_List_Table` and `WP_Posts_List_Table`.
See #40208.

git-svn-id: https://develop.svn.wordpress.org/trunk@40309 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 03:44:51 +00:00
Sergey Biryukov 9dcc276ebc Docs: Add missing `@global` entry for list table view mode in `WP_Screen::render_view_mode()`.
Props priyankabehera155.
See #40208.

git-svn-id: https://develop.svn.wordpress.org/trunk@40308 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 03:44:27 +00:00
Sergey Biryukov 964cf92a57 Docs: Add missing `@global` entry for list table view mode in `wp_ajax_inline_save()`.
Props priyankabehera155.
See #40208.

git-svn-id: https://develop.svn.wordpress.org/trunk@40307 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 03:44:10 +00:00
Rachel Baker bf7d411330 REST API: Confirm the parent post object of an attachment exists in `WP_REST_Posts_Controller::check_read_permission()`.
Avoid a PHP Error when attempting to embed the parent post of an attachment, when the parent post ID is invalid. Instead check if the parent post object exists before checking the read permission for the parent post.

Props GhostToast.
Fixes #39881. 


git-svn-id: https://develop.svn.wordpress.org/trunk@40306 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-20 04:29:50 +00:00
Felix Arntz e6fda09261 Multisite: Handle sites cache invalidation more granularly for option updates.
Previously `update_blog_option()` would trigger an invalidation of that site's entire cache although these changes did not affect the content of these caches. Furthermore changes to the special options `blogname`, `siteurl` and `post_count` should not invalidate the entire cache of that site, but only their respective site details cache. The option `home` now has the same behavior as it also belongs to the site details, but did not invalidate the cache at all previously.

Several new unit tests confirm these changes work as expected.

Fixes #40063.


git-svn-id: https://develop.svn.wordpress.org/trunk@40305 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-19 16:21:38 +00:00
Weston Ruter bba28d7f77 Customize: Fix failure to collapse expanded sections and panels that become deactivated.
Improve jsdoc for `onChangeActive` function. Restores fix from [34557] which got dropped in [38648].

Props dlh, westonruter.
See #34391, #33509.
Fixes #39430.


git-svn-id: https://develop.svn.wordpress.org/trunk@40304 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-19 00:03:36 +00:00
Pascal Birchler 5edb0d57ab Taxonomy: Add missing REST API properties to `WP_Taxonomy` class.
Props danielbachhuber.
Fixes #39987.

git-svn-id: https://develop.svn.wordpress.org/trunk@40303 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-18 15:24:18 +00:00
Pascal Birchler 22fbd05106 Posts, Post Types: Add missing REST API properties to `WP_Post_Type` class.
Props danielbachhuber.
Fixes #39986.

git-svn-id: https://develop.svn.wordpress.org/trunk@40302 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-18 15:16:28 +00:00
Rachel Baker c34a5bc8c9 Themes: Add filter for excluding directories from being scanned for template files.
Exclude 'node_modules' directories from paths searched in `WP_Theme::scandir()`. Introduces the `theme_scandir_exclusions` filter to allow sites to exclude any other paths like `bower_components` or `vendor` from being searched for template files.

Props lukasbesch, dd32, swisspidy, rachelbaker. 
Fixes #38292. 


git-svn-id: https://develop.svn.wordpress.org/trunk@40301 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-18 03:53:59 +00:00
Weston Ruter 83de39a7fb Customize: Trailingslash the home nav menu item URL in starter content.
This prevents an additional 301 redirect when clicking on the nav menu item, and it also prevents a scenario where the auth cookie may not be passed and cause an authentication error when navigating in the customizer.

Props dlh, swissspidy.
Fixes #40112.


git-svn-id: https://develop.svn.wordpress.org/trunk@40300 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-18 03:22:08 +00:00
Sergey Biryukov d98ee0cd18 Docs: Fix typo in `wp_parse_url()` and `_get_component_from_parsed_url_array()` docblocks.
Props naomicbush.
Fixes #40190.

git-svn-id: https://develop.svn.wordpress.org/trunk@40299 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-17 19:01:16 +00:00
Drew Jaynes cf84f5dde5 Docs: Add a missing return description for `get_post_taxonomies()`.
h/t deeptiboddapati.
See #39130.


git-svn-id: https://develop.svn.wordpress.org/trunk@40298 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-17 17:26:27 +00:00
Pascal Birchler 11d556e42b List Tables: Hide 'Empty Trash' and 'Empty Spam' buttons when view is already empty.
Props ivantedja, Presskopp, printsachen1, Jaydeep Rami, mathieuhays, cazm.
Fixes #38341.

git-svn-id: https://develop.svn.wordpress.org/trunk@40297 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-17 16:53:08 +00:00
Pascal Birchler e14051c031 Multisite: Ensure first page/post/comment content is not empty when setting up a new site.
This prevents creating page without any content when the options are populated with an empty string.

Props shadyvb.
Fixes #40036.

git-svn-id: https://develop.svn.wordpress.org/trunk@40296 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-17 15:48:35 +00:00
Felix Arntz eb7a3d1a2f Multisite: Remove restriction of minimum site name length in `wpmu_validate_blog_signup()`.
It is sometimes desirable to support shorter site names than 4 characters, therefore that restriction should be removed. It is still possible to manually enforce it by using the `wpmu_validate_blog_signup` filter.

As a result of this change, another `is_super_admin()` call gets removed which affects the ongoing efforts of working on a network-wide role system.

Props milindmore22.
Fixes #39676. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@40295 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-17 14:35:08 +00:00
Felix Arntz 169c32723f Multisite: Provide unit tests for `wpmu_validate_blog_signup()`.
See #39676.


git-svn-id: https://develop.svn.wordpress.org/trunk@40294 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-17 14:14:14 +00:00
Boone Gorges 79cfdbd84c Improve querying for terms with falsey names and slugs.
Prior to [38677], `get_term_by()` would always return false if
an empty string were passed as the queried 'name' or 'slug'. The
refactor to use `get_terms()` broke this behavior; inappropriately
imprecise `empty()` checks caused the 'name' or 'slug' clause to be
discarded altogether when fetching terms, resulting in an incorrect
term being returned from the function.

We fix the regression by special-casing truly empty values passed
to `get_term_by()`, and ensuring that `WP_Term_Query` is properly
able to handle `0` and `'0'` term queries.

Props sstoqnov.
Fixes #21760.

git-svn-id: https://develop.svn.wordpress.org/trunk@40293 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-16 02:03:53 +00:00
Boone Gorges 24b221bd34 Streamline `get_terms()` parameter documentation.
Since 4.6, `get_terms()` has been a wrapper for `WP_Term_Query`.
Full parameter documentation lives with the class, and
`get_terms()` should reference rather than duplicate it.

Props shashwatmittal.
Fixes #37075.

git-svn-id: https://develop.svn.wordpress.org/trunk@40292 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-16 01:34:52 +00:00
Boone Gorges 3025ba4c8f Fix the formatting of `$taxonomies` parameter of `'wp_get_object_terms'` filter.
[38667] changed the way that the filter parameters are built. That
changeset didn't fully account for the pre-4.7 format of `$taxonomies`.

Props ig_communitysites.
Fixes #40154.

git-svn-id: https://develop.svn.wordpress.org/trunk@40290 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-14 18:41:26 +00:00
James Nylen b9dd2c01f3 REST API: Fix DST handling in a test.
The time chosen for `test_empty_post_date_gmt_shimmed_using_post_date` falls within US daylight savings time.  This may cause the test to fail depending on whether the current locale has DST.

The fix is to specify a numeric `gmt_offset` rather than a `timezone_string`.

Unprops jnylen0.
Fixes #40136.


git-svn-id: https://develop.svn.wordpress.org/trunk@40284 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-13 15:06:10 +00:00
azaozz 69399f4463 Improve wording of the AYS warning when permanently deleting uploads, tags, posts.
Props dllh, gma992.
Fixes #39712 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40283 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-11 19:32:08 +00:00
Sergey Biryukov 2d52993e4f Docs: Correct the description for `wp.updates.deleteTheme`.
Props MattyRob.
Fixes #40110.

git-svn-id: https://develop.svn.wordpress.org/trunk@40279 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-11 16:12:49 +00:00
Boone Gorges 5e74056898 Tests: Use `assertSame()` for `WP_Query` 'orderby' tests.
`assertEqualSets()` ignores order, so isn't much good for testing 'orderby'.

See #38034.

git-svn-id: https://develop.svn.wordpress.org/trunk@40278 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-11 03:07:27 +00:00
Boone Gorges 824c50f8ae 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@40275 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-11 02:26:11 +00:00
John Blackbourn 5d65051985 Build/Test tools: Don't install PHPUnit on the `travis:js` builds. Saves a couple of minutes of build time.
See #40100


git-svn-id: https://develop.svn.wordpress.org/trunk@40271 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 23:56:07 +00:00
Sergey Biryukov 0a1782bb45 Twenty Seventeen: Correct grammar in 'Page Layout' control description.
Props zoonini, laurelfulford.
Fixes #40107.

git-svn-id: https://develop.svn.wordpress.org/trunk@40270 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 23:34:39 +00:00
John Blackbourn 0df4906f9a 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


git-svn-id: https://develop.svn.wordpress.org/trunk@40269 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 22:57:31 +00:00
Andrea Fercia 44b84f75e4 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40268 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 19:14:00 +00:00
John Blackbourn f5fddde456 Build/Test tools: Don't attempt to report PHP's extensions when running HHVM jobs on Travis. It doesn't work.
git-svn-id: https://develop.svn.wordpress.org/trunk@40267 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 15:30:33 +00:00
John Blackbourn 44a5ef78d7 Docs: Remove the duplicate hook documentation for the newly introduced `send_auth_cookies` filter.
See #39367


git-svn-id: https://develop.svn.wordpress.org/trunk@40264 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 15:02:43 +00:00
John Blackbourn f5f7736177 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


git-svn-id: https://develop.svn.wordpress.org/trunk@40263 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 14:32:31 +00:00
John Blackbourn 509b17b6c9 Build/test tools: Add some more debugging to Travis and bring the format of the Xdebug fix inline with branches.
git-svn-id: https://develop.svn.wordpress.org/trunk@40259 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-09 21:47:20 +00:00
Dominik Schilling (ocean90) 7ba64e2288 Build/Test Tools: On Travis CI install and use the node version which is specified in package.json.
Props netweb.
See #35105.

git-svn-id: https://develop.svn.wordpress.org/trunk@40258 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-09 21:08:09 +00:00
John Blackbourn 38f5797e3c Build/Test tools: Account for PHP 5.2 when using Composer to install PHPUnit.
See #39822, #40086


git-svn-id: https://develop.svn.wordpress.org/trunk@40257 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-09 20:53:37 +00:00
Sergey Biryukov 8060823ff3 Canonical: Strip trailing punctuation from permalinks.
Props joostdevalk, lancewillett, SergeyBiryukov.
Fixes #20383.

git-svn-id: https://develop.svn.wordpress.org/trunk@40256 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-09 20:04:17 +00:00
John Blackbourn 15ae03f4ab 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


git-svn-id: https://develop.svn.wordpress.org/trunk@40255 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-09 19:13:25 +00:00
Sergey Biryukov 754dd5c11e Docs: Correct `@return` type for `calendar_week_mod()`.
Props dingo_bastard.
Fixes #40077.

git-svn-id: https://develop.svn.wordpress.org/trunk@40254 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-09 14:00:09 +00:00
John Blackbourn 91e1ae2a70 Build/Test tools: Remove the unnecessary clone of the twentysixteen repo.
This is no longer needed since #31550.

Fixes #40066


git-svn-id: https://develop.svn.wordpress.org/trunk@40252 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-09 01:10:54 +00:00
Weston Ruter 34759c5d65 Customize: Show title input placeholders for widgets that have default titles when rendered.
Fixes #39909.
Props bor0, dlh, westonruter.


git-svn-id: https://develop.svn.wordpress.org/trunk@40251 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-08 18:24:16 +00:00
John Blackbourn 74e02a21b8 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


git-svn-id: https://develop.svn.wordpress.org/trunk@40241 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-08 00:06:12 +00:00
John Blackbourn 0060ffaa8c Build/Test tools: Revert [40239] due to unrelated changes.
See #39486


git-svn-id: https://develop.svn.wordpress.org/trunk@40240 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-08 00:04:05 +00:00
John Blackbourn 868eba6850 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


git-svn-id: https://develop.svn.wordpress.org/trunk@40239 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-08 00:00:47 +00:00
James Nylen 8bbe6a0d50 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40238 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-07 05:47:32 +00:00
James Nylen e79e137c32 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@40237 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-07 05:26:51 +00:00
John Blackbourn 154d0d15b7 Build/Test Tools: Call `wp_head()` and `wp_footer()` in the theme used during tests.
See #31550
Fixes #39988


git-svn-id: https://develop.svn.wordpress.org/trunk@40235 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-07 01:33:04 +00:00
John Blackbourn d5b9305fa3 Press This: Verify intent before fetching in-page resources using Press This.
Props vortfu


git-svn-id: https://develop.svn.wordpress.org/trunk@40195 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 13:54:58 +00:00
Aaron D. Campbell ec30770c50 Strip control characters before validating redirect.
git-svn-id: https://develop.svn.wordpress.org/trunk@40183 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 13:37:43 +00:00
John Blackbourn 47c966dffc Taxonomy: Correct the formatting of HTML entities when generating the screen reader text for tag removal.
Props adamsilverstein


git-svn-id: https://develop.svn.wordpress.org/trunk@40181 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 13:13:57 +00:00
Aaron D. Campbell 4e13bc0bea Plugins: Add file check to plugin deletions.
git-svn-id: https://develop.svn.wordpress.org/trunk@40169 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 12:54:07 +00:00
Dominik Schilling (ocean90) ccfe51c3b9 Embeds: URL encode YouTube video IDs for broader compatibility.
git-svn-id: https://develop.svn.wordpress.org/trunk@40160 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 11:41:47 +00:00