Commit Graph

36439 Commits

Author SHA1 Message Date
flixos90 707bf79a9b Multisite: Add `$network_id` parameter to `get_user_count()`.
The `get_user_count()` function returns the number of active users on a network, which is stored in a `user_count` network option. Since `get_network_option()` supports retrieving options from other networks than the current one, `get_user_count()` can now make use of that feature.

Fixes #37866.


git-svn-id: https://develop.svn.wordpress.org/trunk@40371 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-03 23:31:33 +00:00
flixos90 117f2da3cc Multisite: Support the `$network_id` parameter of `get_blog_count()`.
The `get_blog_count()` function used to support an `$id` parameter for the network ID prior to WordPress 3.1. This parameter has not been used since the introduction of `get_site_option()` and was later deprecated in [25113]. With `get_network_option()` however it is possible to support the parameter again, now properly renamed as `$network_id`.

A unit test has for the parameter has been added as well. Another unit test in the same class was adjusted to work properly with multiple networks existing.

Fixes #37865.


git-svn-id: https://develop.svn.wordpress.org/trunk@40370 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-03 23:13:40 +00:00
swissspidy 7734535fe7 Customize: User `get_user_locale()` in customizer body class.
Otherwise CSS specific to the site's locale would be applied, even though the customizer is displayed in the user's locale.

See #29783.
Fixes #40271.


git-svn-id: https://develop.svn.wordpress.org/trunk@40368 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-03 22:36:35 +00:00
Adam Silverstein 926853f3a3 REST API: JS Client - Enable connecting to multiple endpoints.
Enable connecting to multiple wp-api `endpoints`. Calling `wp.api.init` with a new `apiRoot` will parse the new endpoint's schema and store a new set of models and collections. A collection of connected endpoints is stored in `wp.api.endpoints`.

Props lucasstark.
Fixes #39683.



git-svn-id: https://develop.svn.wordpress.org/trunk@40364 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-02 19:40:37 +00:00
Sergey Biryukov 7e298b0ceb Mail: Use correct capitalization for PHPMailer methods in `wp_mail()`.
Props Soean, reidbusi.
Fixes #39702.

git-svn-id: https://develop.svn.wordpress.org/trunk@40363 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-01 14:33:59 +00:00
Sergey Biryukov 39c77f5f3a I18N: Remove an extra slash between `.mo` file path and name in `load_muplugin_textdomain()`.
Props nsundberg.
Fixes #39168.

git-svn-id: https://develop.svn.wordpress.org/trunk@40362 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-01 14:25:08 +00:00
Sergey Biryukov d766856878 Posts, Post Types: Introduce `post_date_column_status` filter for post status text in list tables' Date column.
Props pbearne.
Fixes #39545.

git-svn-id: https://develop.svn.wordpress.org/trunk@40361 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-01 14:07:01 +00:00
Sergey Biryukov 7fcef3062b Embeds: Change the `embed_autourls` option filter from `default_option_*` to `pre_option_*` to avoid a DB query.
The option was removed from core in [21998], but still might be used by plugins.

Props dlh.
Fixes #38924.

git-svn-id: https://develop.svn.wordpress.org/trunk@40360 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-01 13:55:29 +00:00
Andrea Fercia 9b0de1429d Accessibility: Improve the Media Library inline uploader accessibility.
For better accessibility, expandable panels should be placed immediately after
the control that expands them. This change moves the Media Library inline
uploader up, right after the "Add New" button, also introducing consistency with
the Plugin and Theme uploaders.
Adds a proper ARIA role on the button and an `aria-expanded` attribute to give
better feedback to assistive technologies users about the uploader's expanded state.
Improves the focus handling when closing the uploader, improves the focus style
and color contrast ratio of the uploader "close" button.

Props mantismamita, karmatosed, adamsilverstein, afercia.
Fixes #37188.


git-svn-id: https://develop.svn.wordpress.org/trunk@40359 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-31 17:37:58 +00:00
Andrea Fercia fadd7cb721 Administration: Fix minor misalignments caused by the `button-link` CSS class.
After [40059] the CSS class `button-link` uses `text-align: left` by default.
This change now requires to limit as much as possible the use of `button-link`
to controls that should really look like links and to explicitly set
`text-align: center` in a few other cases.

Fixes #39983.


git-svn-id: https://develop.svn.wordpress.org/trunk@40358 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-31 16:50:42 +00:00
Andrea Fercia fb3e6ea250 Quick/Bulk Edit: Fix the Tag suggestions position on the Bulk Edit textarea.
Always passes the complete `position` object to the jQuery autocomplete widget.
Also checks if an autocomplete instance already exists on the Bulk Edit textarea.

Props davidbenton.
Fixes #40242.


git-svn-id: https://develop.svn.wordpress.org/trunk@40357 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-31 16:34:52 +00:00
Sergey Biryukov e4ab5c306d Press This: Reorder post format icon styles for consistency with `get_post_format_strings()`.
See #40304.

git-svn-id: https://develop.svn.wordpress.org/trunk@40356 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-31 08:21:04 +00:00
Sergey Biryukov d1442e955a Press This: Add missing icons for Chat and Status post formats.
Props menakas, ejner69.
Fixes #40304.

git-svn-id: https://develop.svn.wordpress.org/trunk@40355 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-31 08:18:04 +00:00
Boone Gorges cc1c0639d0 Invalidate term query caches when setting or deleting term relationships.
Prior to 4.7, term relationships - as set by `wp_set_object_terms()` or
`wp_remove_object_terms()` - did not affect the term query cache. The
introduction of the 'object_ids' parameter in 4.7 means that the query
cache must be aware of object-term relationships. As such, the
'last_changed' incrementor is now invalidated when term relationships
are modified.

This bug only reared its head when delaying term counting, because term
counting performs its own term query cache invalidation.

Props mboynes.
Fixes #40306.

git-svn-id: https://develop.svn.wordpress.org/trunk@40353 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-30 16:49:47 +00:00
Jeremy Felt 2cd890decc Multisite: Correct documentation for site status change hooks.
Props johnbillion.
Fixes #40287.


git-svn-id: https://develop.svn.wordpress.org/trunk@40352 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-30 04:35:09 +00:00
Jeremy Felt 54edf92498 Multisite: Add `deleted_blog` action after site has been deleted.
Props pauldewouters, johnjamesjacoby.
Fixes #25584.


git-svn-id: https://develop.svn.wordpress.org/trunk@40351 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-30 04:30:27 +00:00
James Nylen c7f1aeb441 Tests: Remove a couple of invalid error assertions.
A couple of REST API tests had an assertion `assertNotInstanceOf( 'WP_Error', $response );` which will never be true.

Since these assertions are invalid, and also made redundant by the response status check, we can just remove them.

Props dlh.
Fixes #40270.


git-svn-id: https://develop.svn.wordpress.org/trunk@40350 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-29 17:05:41 +00:00
Sergey Biryukov b9de0d7f10 Docs: Add an entry for `$pagenow` global in `WP_Customize_Manager::setup_theme()`.
Props mt8.biz.
Fixes #40297.

git-svn-id: https://develop.svn.wordpress.org/trunk@40349 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-29 11:40:01 +00:00
Sergey Biryukov 21310844e3 Taxonomy: Fix typo in `$aria_checked` variable name in `Walker_Category_Checklist::start_el()`.
Props dhanendran.
Fixes #40295.

git-svn-id: https://develop.svn.wordpress.org/trunk@40348 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-29 11:21:26 +00:00
Jeremy Felt 8cc8a221fc Multisite: Remove unused `site-lookup` global cache group.
The `site-lookup` group was introduced in WPMU, but never actually used in WordPress core.

Props johnjamesjacoby.
Fixes #38725.


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