Commit Graph

37130 Commits

Author SHA1 Message Date
Felix Arntz
440c8692e3 Multisite: Remove references to $wpdb->siteid and use get_current_network_id() instead.
Props sathyapulse, spacedmonkey.
Fixes #41507.


git-svn-id: https://develop.svn.wordpress.org/trunk@41242 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-12 13:10:24 +00:00
Felix Arntz
9595e6c38b Multisite: Rename internal $site_id variables referencing networks to $network_id.
This change improves code clarity by using the current naming conventions for networks.

Props lemacarl.
Fixes #41510.


git-svn-id: https://develop.svn.wordpress.org/trunk@41241 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-12 12:47:38 +00:00
Weston Ruter
0979d6ebfb Media: Upgrade MediaElement.js from 4.2.3 to 4.2.5.
Props rafa8626.
See #39686.


git-svn-id: https://develop.svn.wordpress.org/trunk@41240 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-12 06:19:28 +00:00
Adam Silverstein
1306166cb9 Docs: Improve JavaScript documentation in audiovideo.manifest.js.
Add and improve JSDOC blocks.

Props nicollle, manuelaugustin.
Fixes #41602.


git-svn-id: https://develop.svn.wordpress.org/trunk@41239 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-11 20:36:19 +00:00
James Nylen
d570de32ca REST API: Always call rest_get_server() instead of accessing the $wp_rest_server global.
This is a consistency improvement and also a bug fix for fairly obscure cases involving modified WP load order.

Fixes #41555.


git-svn-id: https://develop.svn.wordpress.org/trunk@41238 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-10 01:37:30 +00:00
Konstantin Obenland
d339af1bc1 Map nav menu locations on theme switch
This will send nav menu locations through three levels of mapping:
1. If both themes have only one location, that gets mapped.
2. If both themes have locations with the same slug, they get mapped.
3. Locations that (even partially) match slugs from a similar kind of menu location will get mapped.

Menu locations are mapped for Live Previews in the Customizer and during theme switches.

Props westonruter, obenland, welcher, melchoyce.
Fixes #39692.



git-svn-id: https://develop.svn.wordpress.org/trunk@41237 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-09 21:03:16 +00:00
Sergey Biryukov
9ab26b8800 Link Template: Allow the type argument to be passed through get_the_comments_pagination() as long as its value isn't array.
See [30820] for `get_the_posts_pagination().

Props jainnidhi, poena.
Fixes #39792.

git-svn-id: https://develop.svn.wordpress.org/trunk@41236 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-09 04:06:17 +00:00
Sergey Biryukov
4a8779feb9 Docs: Correct @param type for $term_id in get_term_children().
Props Soean, wido.
Fixes #41585.

git-svn-id: https://develop.svn.wordpress.org/trunk@41235 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-08 20:52:01 +00:00
Sergey Biryukov
0e0e31d515 Media: Pass shortcode attributes to wp_audio_shortcode_class and wp_video_shortcode_class filters.
Props sathyapulse.
Fixes #37329.

git-svn-id: https://develop.svn.wordpress.org/trunk@41234 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-05 16:41:39 +00:00
Drew Jaynes
fff8e29cbf External Libraries: Update jQuery Form (unused in core) to the latest version, 4.2.1.
Fixes #41565.


git-svn-id: https://develop.svn.wordpress.org/trunk@41233 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-05 12:59:12 +00:00
John Blackbourn
1f26d318ab Formatting: Introduce get_the_post_type_description() to allow post type archive descriptions to be formatted the same as author and term archives.
Props henry.wright

Fixes #40040


git-svn-id: https://develop.svn.wordpress.org/trunk@41232 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 23:00:50 +00:00
John Blackbourn
db49a16f00 Plugins: Correct and improve docblocks for the various plugin_action_links filters on the Plugins screen.
This also adds a changelog for the removal of the Edit links in [41160].

See #41017
Fixes #38169


git-svn-id: https://develop.svn.wordpress.org/trunk@41231 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 22:14:37 +00:00
John Blackbourn
e45625b5b0 Multisite: Clarify descriptions of the wpmu_signup_blog_notification() and wpmu_signup_user_notification() functions.
See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41230 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 14:20:21 +00:00
John Blackbourn
3e5005c30c Media: Move the Tests_Media::test_video_shortcode_body() method so it runs before other tests in the class that depend on it.
The following tests were never executed as they have `@depends` annotations which means they get skipped because the `test_video_shortcode_body()` test has not run by the time they run. Re-ordering the test methods fixes this.

* `test_wp_video_shortcode_with_empty_params()`
* `test_wp_video_shortcode_with_bad_attr()`
* `test_wp_video_shortcode_attributes()`
* `test_wp_video_shortcode_youtube_remove_feature()`
* `test_wp_video_shortcode_youtube_force_ssl()`
* `test_wp_video_shortcode_vimeo_force_ssl_remove_query_args()`
* `test_wp_video_shortcode_vimeo_adds_loop()`
* `test_wp_video_shortcode_vimeo_force_adds_loop_true()`

See #35367


git-svn-id: https://develop.svn.wordpress.org/trunk@41229 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 14:05:27 +00:00
John Blackbourn
14ff8eb16b REST API: Populate some missing tests from test cases which extend the controller test case.
See #41463


git-svn-id: https://develop.svn.wordpress.org/trunk@41228 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-04 13:55:04 +00:00
Andrea Fercia
babec6d399 Menus: Visually hide the menu item edit link text in a consistent way.
Fixes a visual glitch visible on Ubuntu. WordPress uses system fonts and they have
different metrics across operating systems. Uses screen-reader-text as a more
solid way to visually hide text.

Props punit5658, afercia.
Fixes #41497.


git-svn-id: https://develop.svn.wordpress.org/trunk@41227 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 22:12:01 +00:00
Felix Arntz
1e9777c220 REST API: Allow site administrators to edit user roles in multisite.
While site administrators cannot generally edit users in multisite, they have always been able to change the roles of users on their site. In the REST API however, this has not been possible so far. This changeset brings parity with how it is handled in the administration panel: A REST request to edit only a user's roles succeeds correctly, while a REST request to edit any further details of a user fails.

Props jnylen0.
Fixes #40263.


git-svn-id: https://develop.svn.wordpress.org/trunk@41226 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 21:58:50 +00:00
flixos90
0dc1e0633b Multisite: Introduce a can_add_user_to_blog filter to prevent adding a user to a site.
Under certain circumstances, it can be necessary that a user should not be added to a site, beyond the restrictions that WordPress core applies. With the new `can_add_user_to_blog` filter, plugin developers can run custom checks and return an error in case of a failure, that will prevent the user from being added.

The user-facing parts and the REST API route that interact with `add_user_to_blog()` have been adjusted accordingly to provide appropriate error feedback when a user could not be added to a site. Furthermore, two existing error feedback messages in the site admin's "New User" screen have been adjusted to properly show inside an error notice instead of a success notice.

Props jmdodd.
Fixes #41101.


git-svn-id: https://develop.svn.wordpress.org/trunk@41225 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 21:40:02 +00:00
Andrea Fercia
814e1f5530 REST API: Make jshint happy again after [41222].
See #40919.


git-svn-id: https://develop.svn.wordpress.org/trunk@41224 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 20:35:38 +00:00
James Nylen
da5ece4d6d REST API: Exclude numeric parameters from regex parsing
The list of endpoint parameters should only include explicitly named and requested parameters.

Props flixos90, rmccue, jnylen0.
Fixes #40704.


git-svn-id: https://develop.svn.wordpress.org/trunk@41223 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 19:54:56 +00:00
James Nylen
4f4b7fd8d1 REST API: Add QUnit tests for api-request.js
These should have been included in [41206].

See #40919.


git-svn-id: https://develop.svn.wordpress.org/trunk@41222 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 19:46:48 +00:00
John Blackbourn
17fe24286d General: Fix more instances of inconsistent parameters passed to various filters, plus fix some filter docs.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41221 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 16:12:25 +00:00
John Blackbourn
a3dec5dd51 General: Fix a typo introduced in [41219].
See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41220 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:45:14 +00:00
John Blackbourn
3aadc71579 General: Fix various instances of incorrect filter docs and incorrect filter and action parameters.
Props keesiemeijer for identifying the issues

See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41219 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:42:45 +00:00
Drew Jaynes
70027dd170 Docs: Add missing documentation for the $data parameter for WP_Http::browser_redirect_compatibility().
Props ronakganatra for the initial patch.
Fixes #41380.


git-svn-id: https://develop.svn.wordpress.org/trunk@41218 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 15:23:25 +00:00
John Blackbourn
136aa0d6d0 General: Add missing parameters to instances of the the_permalink filter.
This ensures every instance of this filter receives the same parameters.

Props keesiemeijer for identifying the issue

See #38462


git-svn-id: https://develop.svn.wordpress.org/trunk@41217 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 14:58:26 +00:00
John Blackbourn
84ef824166 Docs: Add a missing docblock for the the_content_rss filter.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41216 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 14:45:58 +00:00
John Blackbourn
9f180065d6 Docs: Fix various filter documentation.
See #38462, #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41215 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 14:33:19 +00:00
John Blackbourn
9296c9025a Networks and Sites: Display an indicator for the active theme or child theme when viewing a site's themes within Network Admin.
Props palmiak, euthelup

Fixes #41168


git-svn-id: https://develop.svn.wordpress.org/trunk@41214 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 13:49:01 +00:00
John Blackbourn
1a53140ba3 Users: Switch to using array style filters for the newly introduced filters in wp_password_change_notification() and wp_new_user_notification().
This introduces three new filters, replacing those that were introduced in [41153]:

* `wp_password_change_notification_email`
* `wp_new_user_notification_email_admin`
* `wp_new_user_notification_email`

Props pbearne

Fixes #38068


git-svn-id: https://develop.svn.wordpress.org/trunk@41213 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-03 13:20:38 +00:00
John Blackbourn
6a77621be4 Docs: Correct and improve the documentation for the send_confirmation_on_profile_email() function and the new_user_email_content filter.
See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41209 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 20:42:17 +00:00
John Blackbourn
43d241f0c4 Docs: Correct and improve the documentation for the update_option_new_admin_email() function and the new_admin_email_content filter.
See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41208 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 20:03:29 +00:00
James Nylen
2adead72ca Remove unnecessary semicolon
See #40919.


git-svn-id: https://develop.svn.wordpress.org/trunk@41207 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 17:15:24 +00:00
James Nylen
1c28b4a3c8 REST API: Allow overriding jQuery.ajax calls from within wp-admin
There are now 3 places where we call out to the REST API from within wp-admin.  This commit introduces a small library to allow overriding these calls, centralize nonce-passing logic, and eliminate the need to pass a full REST URL down to client code (this last feature is not yet used and will be explored in a separate ticket).

Fixes #40919.


git-svn-id: https://develop.svn.wordpress.org/trunk@41206 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 16:44:05 +00:00
Weston Ruter
9c1005410f Customize: Introduce settings_previewed arg and getter on WP_Customize_Manager which controls whether WP_Customize_Setting::preview() should be called on settings.
The `settings_previewed` property eliminates the need for the Customizer components from having to look at global `doing_ajax` state. This is in particular needed when saving settings, as some settings will short-circuit the update operation if they detect no changes are introduced. This is also needed for low-level integrations with the Customizer, such as in REST API endpoints under development.

Props stubgo, westonruter, utkarshpatel for testing.
See #38900.
Fixes #39221.


git-svn-id: https://develop.svn.wordpress.org/trunk@41205 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 05:34:32 +00:00
Weston Ruter
57e57505ba Customize: For selective refresh of nav menus, prevent preg_replace() from dropping backslashes in JSON replaced into the data-customize-partial-placement-context HTML attribute.
Props dlh, westonruter.
Fixes #41488.


git-svn-id: https://develop.svn.wordpress.org/trunk@41204 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-02 05:10:05 +00:00
Drew Jaynes
bce1b14c9a Docs: Reduce confusion in @since MU notationss by indicating the WP version (3.0.0) the code was merged into core while retaining the original context.
Props sathyapulse.
Fixes #41509.


git-svn-id: https://develop.svn.wordpress.org/trunk@41200 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 20:43:25 +00:00
John Blackbourn
be97d71a94 Formatting: Add the $number and $decimals arguments to the number_format_i18n filter.
Props alpipego

Fixes #41505


git-svn-id: https://develop.svn.wordpress.org/trunk@41199 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 14:37:39 +00:00
Weston Ruter
a0748817c6 Media: Upgrade MediaElement.js from 2.22.0 to 4.2.3.
Props rafa8626, grosbouff, westonruter, azaozz, Plastikschnitzer for testing.
See #39686.


git-svn-id: https://develop.svn.wordpress.org/trunk@41198 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-01 04:42:58 +00:00
Andrea Fercia
0ac2a97aad Menus: Improve the responsive view for the Menu Name field and Save button.
Props punit5658.
Fixes #41499.


git-svn-id: https://develop.svn.wordpress.org/trunk@41197 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-31 21:21:02 +00:00
Scott Taylor
a8aaaa4bca Media: update the getID3 library to version 1.9.14 to avoid fatal errors in PHP7.
Props MyThemeShop for the initial patch.
Fixes #41496.


git-svn-id: https://develop.svn.wordpress.org/trunk@41196 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-31 19:49:31 +00:00
Drew Jaynes
83abe4dbfc Docs: Use a third-person singular verb in the DocBlock summary for WP_Importer::stop_the_insanity().
Also add a missing `@since` tag. Introduced in 3.0.0, see [14760].

See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41195 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 15:45:50 +00:00
Drew Jaynes
8e453de898 Docs: Add a missing description for the $wpdb global notation in the DocBlock for WP_Importer::stop_the_insanity().
Props tejas5989.
Fixes #41447.


git-svn-id: https://develop.svn.wordpress.org/trunk@41194 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 15:42:17 +00:00
Drew Jaynes
2bec067616 Docs: Use a third-person singular verb in the summary for _wp_customize_publish_changeset().
Also adding missing `@since` and `@access` tags. Introduced in 4.7, see [38810].

See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41193 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 15:33:19 +00:00
Drew Jaynes
51319d3394 Docs: Document use of the $wpdb and $wp_customize globals in _wp_customize_publish_changeset().
Props sagarladani for the initial patch.
Fixes #41479.


git-svn-id: https://develop.svn.wordpress.org/trunk@41192 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 15:30:34 +00:00
Boone Gorges
d7ce3e77e9 Taxonomy: Introduce pre_term_link filter.
This filter allows developers to filter the taxonomy permalink
structure before a term's permalink is generated. It parallels
the 'pre_post_link' filter for the 'post' post type.

Props nikeo.
Fixes #39601.

git-svn-id: https://develop.svn.wordpress.org/trunk@41191 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 15:09:31 +00:00
Boone Gorges
37a8fe8b9b Comments: Ignore the 'fields' parameter in the comment query cache.
`WP_Comment_Query` always queries runs an ID query, and so is unaffected
by the 'fields' parameter. As such, 'fields' can be ignored when building
a cache key for the results of the ID query.

Props spacedmonkey.
Fixes #41348.

git-svn-id: https://develop.svn.wordpress.org/trunk@41190 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 14:55:17 +00:00
Sergey Biryukov
56ba8d18f9 Docs: Replace HTTP links to stackoverflow.com in DocBlocks with HTTPS.
Update the Nginx "Missing (disappearing) HTTP Headers" link.

Props johnpgreen.
Fixes #41331.

git-svn-id: https://develop.svn.wordpress.org/trunk@41189 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 14:51:44 +00:00
Boone Gorges
a42a7970d9 Ensure that an assertion takes place in Tests_Comment_Query::test_comment_query_should_be_cached().
Missed during [37608]. See #36906.

Fixes #41357.

git-svn-id: https://develop.svn.wordpress.org/trunk@41188 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 14:42:56 +00:00
Sergey Biryukov
ddc6fafd06 Post Formats: In bulk_edit_posts(), set post format before the post is updated, for consistency with edit_post().
This makes sure that plugins hooked to `save_post` get the right post format.

Props Chouby, SergeyBiryukov.
Fixes #41396.

git-svn-id: https://develop.svn.wordpress.org/trunk@41187 602fd350-edb4-49c9-b593-d223f7449a82
2017-07-30 14:40:42 +00:00