Commit Graph

36419 Commits

Author SHA1 Message Date
Jeremy Felt
6790fcb55d Multisite: Respect $_wp_suspend_cache_invalidation when clearing network and site caches.
Props johnjamesjacoby.
Fixes #40028.


git-svn-id: https://develop.svn.wordpress.org/trunk@40346 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-28 19:35:49 +00:00
Jeremy Felt
83002e564e Multisite: Allow falsy properties to be cached in site-details.
In previous iterations of `WP_Site`, there was concern that not all properties would be available when storing a site's details in cache. When introduced in [37918], an `ms_loaded` check was added to address this concern. Any properties that are still `false` after `ms_loaded` really are `false` and can be cached as such.

Props flixos90.
Fixes #40247.


git-svn-id: https://develop.svn.wordpress.org/trunk@40344 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-28 02:31:13 +00:00
Jeremy Felt
308554bd84 Tests: Add missing global cache groups.
Add `useremail`, `userslugs`, `networks`, `sites`, and `site-details` as global cache groups when added with unit tests. This aligns the list with the core default.

Fixes #40283.


git-svn-id: https://develop.svn.wordpress.org/trunk@40343 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-28 01:45:43 +00:00
Jeremy Felt
b36363bb69 Tests: Clarify zero path segment tests for get_network_by_path().
The set of assertions in this data provider intend to test a 0 path segment configuration rather than the use of paths.

Fixes #37217.


git-svn-id: https://develop.svn.wordpress.org/trunk@40342 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-28 01:24:44 +00:00
Jeremy Felt
2f39fe479f Tests: Consolidate logic used to skip API fixture generation.
This checks for `is_multisite()` and the minimum PHP version in the same block and removes two `echo` statements previously used to indicate generation had been skipped.

Fixes #40041.


git-svn-id: https://develop.svn.wordpress.org/trunk@40341 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-27 21:04:06 +00:00
Jeremy Felt
ab57ab8e7f Multisite: Add lang_id support to WP_Site_Query.
Sites can now be queried by `lang_id`, `lang__in`, and `lang__not_in`.

Props ocean90.
Fixes #40196.


git-svn-id: https://develop.svn.wordpress.org/trunk@40340 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-27 19:47:53 +00:00
Jeremy Felt
ba254dfa63 Tests: Use utf8mb4 max index length when creating keys.
In [31349], core `varchar` column key lengths were changed from 255 to 191 to support the 767 byte index size limit on standard utf8mb4 MySQL installs. This changes the DB schema tests to match.

Props caseypatrickdriscoll, clarinetlord.
Fixes #35958.


git-svn-id: https://develop.svn.wordpress.org/trunk@40339 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-27 19:33:55 +00:00
Pascal Birchler
8d611dde0d Themes: Fix incorrect annotation for __clear_multi_author_cache() function.
Props flixos90.
See #40063.
Fixes #40262.



git-svn-id: https://develop.svn.wordpress.org/trunk@40334 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-25 15:46:10 +00:00
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