Commit Graph

36411 Commits

Author SHA1 Message Date
Pascal Birchler
ae78742444 Multisite: After [40305], rename clean_site_details_cache() method as it's not really private.
See #40063.



git-svn-id: https://develop.svn.wordpress.org/trunk@40333 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-25 15:30:41 +00:00
westonruter
1e7b157523 Customize: Improve i18n for strings in hidden widget area notices.
Amends [40312].
Props westonruter, ocean90, swissspidy, SergeyBiryukov, michelleweber for copywriting.
See #33567, #33052.
Fixes #39087.


git-svn-id: https://develop.svn.wordpress.org/trunk@40330 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 22:02:02 +00:00
Pascal Birchler
54baae39b2 REST API: Use get_gmt_from_date() when preparing a draft post for response.
This prevents wrong dates when dealing with DST, see [40115] and [40284].

Props nerrad.
Fixes #40136.

git-svn-id: https://develop.svn.wordpress.org/trunk@40324 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 17:31:54 +00:00
John Blackbourn
d0b54885a3 Users: Don't push the current user's role to the top of the list in wp_dropdown_roles().
This brings consistency to the order in which roles are displayed in the `Roles` dropdown when editing users.

Props bor0

Fixes #40162


git-svn-id: https://develop.svn.wordpress.org/trunk@40323 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 14:52:26 +00:00
Sergey Biryukov
13f5d04590 Docs: Correct default value in @param entry for the $num_words parameter of wp_trim_words filter.
Props redrambles.
Fixes #40248.

git-svn-id: https://develop.svn.wordpress.org/trunk@40322 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 00:57:21 +00:00
John Blackbourn
eda002a9d5 Login and Registration: Avoid a potentially incorrect value for the cookie hash on multisite installations that don't have a value in the siteurl network option.
This reverts [38619].

See #34084

Fixes #39497


git-svn-id: https://develop.svn.wordpress.org/trunk@40320 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 19:00:31 +00:00
Weston Ruter
13f7d1c21f Customize: Prevent client-side validation from being cleared when no corresponding server-side validation is present.
See #36944.
Fixes #39770.


git-svn-id: https://develop.svn.wordpress.org/trunk@40319 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 18:11:03 +00:00
Weston Ruter
0cd74be18a Customize: Fix navigation of site in preview on IE11.
Addresses issue in IE11 where the default port number of `:80` is unexpectedly included on `link.host` for links dynamically created by scripts.

Props westonruter, afercia for testing.
See #38409.
Fixes #40198.


git-svn-id: https://develop.svn.wordpress.org/trunk@40318 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 17:24:08 +00:00
Felix Arntz
df23b65221 Multisite: Add further unit tests for get_blog_details().
These tests verify that the returned site object is iterable and contains the expected properties.

See #40228, #40180.


git-svn-id: https://develop.svn.wordpress.org/trunk@40317 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 17:13:14 +00:00
Weston Ruter
8d4d20db2d Customize: Fix selective refresh when customizing the 404 template.
Overrides the 404 status during partial refresh requests to serve back 200 so that the request is not deemed a failure and invoke the fallback behavior (full refresh).

See #27355.
Fixes #40018.


git-svn-id: https://develop.svn.wordpress.org/trunk@40316 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 16:56:57 +00:00
Sergey Biryukov
b971759494 Twenty Seventeen: Declare jQuery as a dependency for navigation.js.
Props chesio.
Fixes #40224.

git-svn-id: https://develop.svn.wordpress.org/trunk@40315 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 16:21:21 +00:00
Weston Ruter
7e4a6a4bf5 Customize: Harden site_icon control template to account for when full image size is missing.
Props aussieguy123, westonruter.
See #36749.
Fixes #40010.


git-svn-id: https://develop.svn.wordpress.org/trunk@40314 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 06:12:01 +00:00
Weston Ruter
cafa85c014 Customize: Prevent links to customize.php from being generated which have query vars from wp_removable_query_args() present.
Props dlh.
See #23367, #32692.
Fixes #31850.


git-svn-id: https://develop.svn.wordpress.org/trunk@40313 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 23:03:28 +00:00
Weston Ruter
9528740aa3 Customize: Show notice in Widgets panel when there are additional widget areas not rendered in preview.
This extends the existing behavior which only showed a message only when there were no widget areas rendered in the preview. The number of non-rendered widget areas is indicated. Also removes needles deletion of `wp.customize.Widgets.data.l10n` property which hindered plugins.

See #33567, #33052.
Fixes #39087.


git-svn-id: https://develop.svn.wordpress.org/trunk@40312 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 19:02:26 +00:00
Sergey Biryukov
78a24d73a7 Twenty Seventeen: Use esc_attr_e() for translatable strings in HTML attributes.
Props bor0.
Fixes #40216.

git-svn-id: https://develop.svn.wordpress.org/trunk@40311 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 03:51:07 +00:00
Sergey Biryukov
c248f03c61 Docs: Add description for $mode global in WP_MS_Sites_List_Table and WP_MS_Users_List_Table.
Fixes #40208.

git-svn-id: https://develop.svn.wordpress.org/trunk@40310 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-22 03:45:22 +00:00
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