Commit Graph

36680 Commits

Author SHA1 Message Date
Sergey Biryukov 43d7215a5c Editor: Define `$suffix` before using it in `_WP_Editors::print_tinymce_scripts()`.
Props imath.
Fixes #40479. See #35760.

git-svn-id: https://develop.svn.wordpress.org/trunk@40477 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-19 12:01:49 +00:00
Andrew Ozz 8a2be37451 Editor: Provide API for the editor to be dynamically instantiated via JS. First run.
See: #35760

git-svn-id: https://develop.svn.wordpress.org/trunk@40476 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-19 02:37:29 +00:00
Pascal Birchler 627ba9254e Twenty Seventeen: Bump version and update the changelog.
Updates changelog to link to Codex pages, like other default themes.

Props swissspidy, davidakennedy.
Fixes #40461.


git-svn-id: https://develop.svn.wordpress.org/trunk@40472 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-18 09:13:17 +00:00
Weston Ruter f5f0aea2a9 Customize: Use fixed-width illustrative placeholder for hex field in color picker to prevent truncation.
Props stormrockwell, sagarprajapati, Presskopp, afercia, tejas5989, westonruter, mayurk for testing.
Fixes #39096.


git-svn-id: https://develop.svn.wordpress.org/trunk@40471 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-18 00:30:07 +00:00
Pascal Birchler 417e3945d2 Twenty Seventeen: Correct heading hierarchy for posts on the front page.
When the posts page is on the front page or within a front page section, the heading hierarchy for the individual post titles needs to be adjusted accordingly.

Props joedolson, celloexpressions, davidakennedy.
Fixes #40264.


git-svn-id: https://develop.svn.wordpress.org/trunk@40458 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-17 10:08:55 +00:00
John Blackbourn b55133da6e Build/Test tools: Reverse the order in which the Travis jobs run.
As a general rule, this means the fastest test jobs now run first because each subsequent version of PHP is faster than the previous. When a committer is patiently waiting for a Travis build to complete, they are at least more likely to see unexpected failures earlier than they otherwise would.

In addition, this updates the JavaScript test job to run on PHP 7.1.

Props netweb

See #39705


git-svn-id: https://develop.svn.wordpress.org/trunk@40434 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-15 17:42:07 +00:00
John Blackbourn f57f03b935 Networks and Sites: Correct a capability check when accessing the Sites -> Add New screen.
Props flixos90

See #39156


git-svn-id: https://develop.svn.wordpress.org/trunk@40433 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-15 17:29:55 +00:00
Sergey Biryukov d68a189288 Docs: Update the length limit in `set_site_transient()` docs after [34030].
Props lukecavanagh, jdgrimes.
Fixes #40455.

git-svn-id: https://develop.svn.wordpress.org/trunk@40432 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-15 09:27:22 +00:00
Adam Silverstein 0bdd57140b Upload: improve legacy SWFUpload event handlers for current jQuery.
Fix an issue where legacy JavaScript for SWFUpload still used jQuery's 
deprecated `live` event which no longer works - switch to using `on`.
This JavaScript is still used by some plugins and themes.

Props MMDeveloper.
Fixes #39886.



git-svn-id: https://develop.svn.wordpress.org/trunk@40431 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-14 16:42:16 +00:00
James Nylen a92edf9e9a Media: Default to always showing the "Create Audio/Video Playlist" buttons.
This avoids a couple of expensive queries that attempt to determine whether the media library contains any audio or video items, and also makes the UI for creating playlists more discoverable.

[40382] and [40421] added filters to allow overriding this behavior; this commit changes the default value of the filters to always show these UI buttons and never run the expensive queries.  The old behavior can still be restored using the filters if desired.

Props sboisvert, adamsilverstein, joemcgill, jnylen0.
Fixes #31071.


git-svn-id: https://develop.svn.wordpress.org/trunk@40430 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-14 11:25:00 +00:00
Pascal Birchler b5ca4cc9c3 Media: Ensure Crop Image is always visible.
Previously, the crop button in the media modal after uploading header images or similar was hidden and the task could not be completed.

Props karinedo, sagarprajapati, Cybr, mayurk.
Fixes #40152.


git-svn-id: https://develop.svn.wordpress.org/trunk@40428 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-14 09:30:37 +00:00
Sergey Biryukov ad73270aa4 Posts, Post Types: In `wp_check_post_lock()`, check if the user with lock exists and return false otherwise.
Props arshidkv12, 1naveengiri.
Fixes #39888.

git-svn-id: https://develop.svn.wordpress.org/trunk@40424 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-13 23:08:03 +00:00
Sergey Biryukov 1fd9d6026d Posts, Post Types: Improve the docs for `wp_check_post_lock()` and `wp_set_post_lock()`.
See #39888.

git-svn-id: https://develop.svn.wordpress.org/trunk@40423 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-13 23:01:20 +00:00
Sergey Biryukov a844db32e2 Administration: Add "(link opens in a new window)" as a screen reader text for "Preview" link on Edit Post screen.
Props rianrietveld.
Fixes #40185.

git-svn-id: https://develop.svn.wordpress.org/trunk@40422 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-13 22:41:50 +00:00
James Nylen 11d450f47e Media: Improve filters that allow overriding slow media queries.
As a follow-up to [40382], this commit makes the following improvements:

- Make the filter names more specific.
- Fix the inline documentation (use `@param` instead of `@return).
- Use `null ===` instead of `is_null` to avoid extra function calls.
- Rename the `$has_audio` and `$has_video` variables now that they actually represent something slightly different.

See #31071.


git-svn-id: https://develop.svn.wordpress.org/trunk@40421 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-13 20:21:45 +00:00
Andrea Fercia 5fcfb9b247 Toolbar: Reset CSS properties that might be inherited from the active Theme.
The Toolbar search field, when the Toolbar is displayed on the frontend, might
inherit CSS properties from the active Theme stylesheet. For example, this
happened with Twenty Seventeen that sets `display: block;` on all the input
fields. Thus, there's the need to reset some CSS properties to avoid inheritance.

Props @sagarprajapati.
Fixes #40313.


git-svn-id: https://develop.svn.wordpress.org/trunk@40418 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-12 16:11:30 +00:00
John Blackbourn 620280474f Build/Test tools: Introduce and implement `assertNotIXRError()` and `assertIXRError()` assertion methods.
This aids in debugging XMLRPC tests which fail, by exposing the `IXR_Error` error message in the assertion failure message.

Fixes #40423


git-svn-id: https://develop.svn.wordpress.org/trunk@40417 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-12 14:58:33 +00:00
John Blackbourn 043d3b54a8 Build/Test tools: Improve the failure message reported by `assertQueryTrue()` so it's a little less cryptic.
Fixes #40411


git-svn-id: https://develop.svn.wordpress.org/trunk@40416 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-11 10:48:00 +00:00
Felix Arntz 78d7aba4ed Multisite: Replace unnecessary `is_super_admin()` check when setting up the initial network.
When using `is_super_admin()` in a non-multisite environment, the function is supposed to check for administrator capabilities. The process of querying all users and filtering them with that function can be optimized by only querying users with the administrator role instead.

Fixes #40406. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@40406 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-10 21:59:59 +00:00
Weston Ruter 1b9c964e81 Customize: Verify availability of `history.replaceState` (in IE9) before attempting to populate `changeset_uuid` parameter.
Props westonruter, timmydcrawford for testing.
Amends [39686].
See #39227.
Fixes #40405.


git-svn-id: https://develop.svn.wordpress.org/trunk@40405 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-10 21:14:50 +00:00
Felix Arntz 1abf42b45e Multisite: Introduce an `upgrade_network` capability.
Prior to this change, a mix of `is_super_admin()` calls and `manage_network` capability checks was used to determine whether the current user could upgrade the network. With this changeset a dedicated capability is introduced that allows more granular handling.

Props dhanendran for the original patch.
Fixes #39205. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@40404 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-10 21:10:48 +00:00
Joe McGill 7ddf1b3ce1 Fix broken audio/video functions when sanitizing ID3 data
This fixes a bug where running `wp_kses_post_deep()` on all the ID3
tag data corrupted blob data.

Fixes #40075, #40085.


git-svn-id: https://develop.svn.wordpress.org/trunk@40400 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-10 01:27:30 +00:00
Andrew Ozz d37198f240 TinyMCE: update the tests for version 4.5.6. Remove default plugins tests, it is quite pointless to keep repeating them at this point.
See #40305.


git-svn-id: https://develop.svn.wordpress.org/trunk@40399 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-09 23:10:15 +00:00
Andrew Ozz 860363337f Update TinyMCE to 4.5.6. Has many improvements and bug fixes. Changelog: https://github.com/tinymce/tinymce/blob/4.5.x/changelog.txt.
Fixes #40305 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40398 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-09 23:00:47 +00:00
Joe McGill 04e3680d1c Media: Improve handling of non-image files in wp_get_image_mime.
This prevents non-image fileypes from returning a mime type of
"application/octet-stream" when `exif_imagetype()` returns `false`.

Props blobfolio.
Fixes #40017.


git-svn-id: https://develop.svn.wordpress.org/trunk@40397 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-09 22:43:04 +00:00
Weston Ruter 3b794d15ae Customize: Fix behavior of clicking Delete Menu link and keep available nav menu items panel open when doing bulk deletion.
Props maguiar, adamsilverstein for testing.
Amends [39548].
Fixes #38953.


git-svn-id: https://develop.svn.wordpress.org/trunk@40396 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 20:21:46 +00:00
Weston Ruter e896940a4e Customize: Auto-expand a widget area section when expanding the Widgets panel if there is only one registered sidebar and it is active.
Introduces `WP_Customize_Panel::$auto_expand_sole_section` property which allows panels to opt-in to the behavior, which the Widgets panel is made to do by default.

Props delawski, westonruter, melchoyce.
Fixes #37471.


git-svn-id: https://develop.svn.wordpress.org/trunk@40395 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 19:26:31 +00:00
Pascal Birchler f44a9eba4e Upgrade/Install: Introduce `wp_disallow_file_mods()` helper function.
This is a wrapper around the checks for the `DISALLOW_FILE_MODS` constant to determine whether file modifications are disallowed.

Props MaximeCulea.
Fixes #38673.


git-svn-id: https://develop.svn.wordpress.org/trunk@40394 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 14:35:39 +00:00
John Blackbourn 49c68e7a9a Networks and Sites: Align the display of site statuses on the Sites listing screen with those of posts on the Posts listing screen.
Fixes #40290


git-svn-id: https://develop.svn.wordpress.org/trunk@40393 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 13:50:12 +00:00
John Blackbourn 2a261f0d7c Build/Test tools: Remove occurrences of `create_function()` in unit tests.
Props desrosj

See #37082


git-svn-id: https://develop.svn.wordpress.org/trunk@40392 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 13:37:39 +00:00
Felix Arntz 4fbac9b3a7 Multisite: Partially revert [40295].
[40295] removed the restriction of a minimum amount of characters for new site names, which could cause unexpected behavior. That changeset is reverted here with the exception of the removal of the `is_super_admin()` check, which can safely be omitted. A new filter for the minimum site name length will be introduced later to be able to modify that behavior.

See #39676, #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@40391 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 13:14:36 +00:00
Felix Arntz 3ca0673036 Multisite: Introduce a `setup_network` capability for setting up multisite.
`setup_network` is a new meta capability that brings more granular control over the permissions to setup a multisite environment. In a non-multisite environment it falls back to `manage_options` while in a multisite it falls back to `manage_network_options`. The introduction of this capability furthermore allows replacing an `is_super_admin()` check.

Props ashokkumar24 for the original patch.
Fixes #39206. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@40390 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-07 12:52:24 +00:00
Pascal Birchler ca0aa133ff Load: Only load `PasswordHash` class when needed.
This reverts [38371] which loaded `class-phpass.php` early in `wp-settings.php` and in turn caused backward compatibility problems.

Props DavidAnderson, ketuchetan.
Fixes #39445.


git-svn-id: https://develop.svn.wordpress.org/trunk@40387 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 18:00:16 +00:00
James Nylen 74e7dab932 Media: Add filters to allow overriding slow media queries.
There are a couple of queries that do a full table scan of attachment posts to support features of the media library.  Pending a more complete solution, allow overriding these queries via filters.

Props sboisvert, jnylen0.
See #31071.


git-svn-id: https://develop.svn.wordpress.org/trunk@40382 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 03:56:38 +00:00
Weston Ruter 86d333dc26 Customize: Fix HTTPS navigation of site in preview on IE11.
Accounts for HTTPS links (port 443) where [40318] only accounted for HTTP links (port 80). Addresses issue in IE11 where the default port number is unexpectedly included on `link.host` for links dynamically created by scripts.

Props mattwiebe.
Amends [40318], [38890].
See #38409.
Fixes #40198.


git-svn-id: https://develop.svn.wordpress.org/trunk@40381 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 00:31:11 +00:00
Weston Ruter e5508461da Customize: Fix reversal of nav menu item's `type` and `object` properties for page stub added in customizer.
Amends [38906].
See #38164.
Fixes #40277.


git-svn-id: https://develop.svn.wordpress.org/trunk@40380 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-05 23:28:13 +00:00
Weston Ruter 4c72c19f0e Customize: Use `is_header_video_active()` as `active_callback` for `external_header_video` control instead of `is_front_page()`.
Use the same `active_callback` as was supplied previously for the `header_video` control in [39240] where this instance was missed.

Amends [39240].
Props pratikshrestha.
See #38738.
Fixes #40308.


git-svn-id: https://develop.svn.wordpress.org/trunk@40379 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-05 23:09:29 +00:00
James Nylen a7b3612f2a REST API: Allow fetching multiple users at once via the `slug` parameter.
This matches similar changes previously made for posts (#38579) and terms (#40027).

Props curdin, MatheusGimenez.
Fixes #40213.


git-svn-id: https://develop.svn.wordpress.org/trunk@40378 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-05 22:24:24 +00:00
James Nylen 66b4bb9809 REST API: Update description string of terms endpoint `slug` parameter.
As a follow-up to [40376], and for consistency with the posts endpoint, we should indicate in the description that the `slug` filter parameter can accept multiple values.

See #40027.


git-svn-id: https://develop.svn.wordpress.org/trunk@40377 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-05 21:07:04 +00:00
James Nylen 99de5d69d7 REST API: Allow fetching multiple terms at once via the `slug` parameter.
This matches a similar change previously made for posts (#38579) and an upcoming change for users (#40213).

Props wonderboymusic, MatheusGimenez, curdin.
Fixes #40027.


git-svn-id: https://develop.svn.wordpress.org/trunk@40376 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-05 20:24:27 +00:00
flixos90 54eb8900dd Multisite: Fix `wp_get_sites()` to return an unlimited amount of sites when passing a falsy `limit` argument.
Props iandunn for the original patch.
Fixes #39879. See #35791.


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