Commit Graph

37192 Commits

Author SHA1 Message Date
Sergey Biryukov
481e055db2 Docs: Correct description for view_mode_post_types filter added in [35357].
Props birgire.
Fixes #41730.

git-svn-id: https://develop.svn.wordpress.org/trunk@41317 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-25 19:26:03 +00:00
Ian Dunn
a794678af4 Dashboard: Discontinue nonessential logging of Events API requests.
These log entries are only useful when troubleshooting unexpected results from the API, which is not common. The vast majority of users are better served by not having their logs cluttered with noise.

For the rare situations where troubleshooting is necessary, it can be achieved by a plugin (see #41217 for an example).

Props Howdy_McGee, dd32.
Fixes #41217.


git-svn-id: https://develop.svn.wordpress.org/trunk@41316 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-25 18:11:04 +00:00
Joe McGill
b05a22066a Media: Prime post caches in 'wp_make_content_images_responsive()'.
In [38296] we replaced `get_post_meta()` with `wp_get_attachment_metadata()`
so that attachment metadata could be consistently filtered. However, this
results in extra post queries which were previously avoided.

This uses `_prime_post_caches()` instead of `update_meta_cache()` to improve
post caching before looping through all images to retrieve attachment metadata.

Props dlh.
Fixes #40490.


git-svn-id: https://develop.svn.wordpress.org/trunk@41315 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-25 16:15:27 +00:00
Scott Taylor
c1694b35d4 Docs: improve JS docs for comment-reply.js
Props andizer, ireneyoast.
Fixes #41548.


git-svn-id: https://develop.svn.wordpress.org/trunk@41314 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:57:18 +00:00
Scott Taylor
1d4fa31a99 Docs: improve JS docs for bookmarklet.js
Props andizer, ireneyoast.
Fixes #41547.


git-svn-id: https://develop.svn.wordpress.org/trunk@41313 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:54:22 +00:00
Sergey Biryukov
fc26b6e006 Widgets: Remove a duplicate require_once() for class-wp-widget-meta.php added in [40640].
Props thingsym.
Fixes #41723.

git-svn-id: https://develop.svn.wordpress.org/trunk@41312 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:51:26 +00:00
Scott Taylor
eda1561563 Docs: improve JS docs for tags.js
Props atimmer, jipmoors.
Fixes #41069.


git-svn-id: https://develop.svn.wordpress.org/trunk@41311 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:51:19 +00:00
Scott Taylor
aec50e2859 Docs: improve JS docs for editor-expand.js
Props IreneYoast, terwdan.
Fixes #41068.


git-svn-id: https://develop.svn.wordpress.org/trunk@41310 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-24 17:47:58 +00:00
Mel Choyce
f3363250d7 Widgets: Add grey background behind image widgets.
When an image in the image widget isn't full-width, it looks like it's floating. This adds a grey background behind images to help ground them in the widget.

Props mrasharirfan.
Fixes #41630.


git-svn-id: https://develop.svn.wordpress.org/trunk@41309 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-23 17:14:25 +00:00
Drew Jaynes
0549e9198a Docs: Clarify the expected usage of the $args parameter as an array in the DocBlock for apply_filters_deprecated(), including an example.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41308 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-23 15:51:21 +00:00
John Blackbourn
a6f8f9668b Build/Test tools: Use the latest in the 4.x and 6.x branches of PHPUnit when running tests on Travis.
Props netweb, ayeshrajans

Fixes #41472


git-svn-id: https://develop.svn.wordpress.org/trunk@41294 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 16:08:33 +00:00
John Blackbourn
e7e9e5b3fb Build/Test tools: Remove usage of DOING_AJAX from the test suite, so all tests that expect either an Ajax request or a
non-Ajax request can operate without being skipped.

Props Mte90

Fixes #41561


git-svn-id: https://develop.svn.wordpress.org/trunk@41293 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 15:07:42 +00:00
John Blackbourn
3eff05cb88 Widgets: Correctly strip slashes from widget and sidebar names to allow namespaced widgets to function correctly.
Fixes #27770

Props jdgrimes


git-svn-id: https://develop.svn.wordpress.org/trunk@41292 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:51:47 +00:00
John Blackbourn
0d407f3625 Login and Registration: Introduce a login_link_separator filter to allow the separator between links in the footer of the
login screen to be filtered.

Props henry.wright

Fixes #40802


git-svn-id: https://develop.svn.wordpress.org/trunk@41291 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:22:24 +00:00
John Blackbourn
9990abec14 Plugins: Introduce singular capabilities for activating and deactivating individual plugins.
This introduces the following meta capabilities:

* `activate_plugin`
* `deactivate_plugin`
* `deactivate_plugins`

The singular `activate_plugin` and `deactivate_plugin` capabilities are used along with the corresponding plugin name when
determining whether or not a user can activate or deactivate an individual plugin.

The plural `deactivate_plugins` capability is used in place of the existing `activate_plugins` capability when determining
whether a user can deactivate plugins.

Each of these new meta capabilities map to the existing `activate_plugins` primitive capability, which means there is no
change in existing behaviour, but plugins can now filter the capabilities required to activate and deactivate individual
plugins.

Fixes #38652 


git-svn-id: https://develop.svn.wordpress.org/trunk@41290 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 14:01:36 +00:00
John Blackbourn
8df2151660 General: Improve terminology used when referring to installations of WordPress and its extensions.
"Install" is not a noun, and while it might be acceptable to use the verb as a noun, it is not correct. Using the correct
noun, "installation", increases clarity, especially for non-native English speakers.

This change fixes the usage in user-facing text and in developer documentation.

Fixes #41620


git-svn-id: https://develop.svn.wordpress.org/trunk@41289 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:51:11 +00:00
John Blackbourn
0613540ea2 Media: Rename several attachment related parameters from $post_id to $attachment_id for clarity, and improve related
documentation.

See #41017


git-svn-id: https://develop.svn.wordpress.org/trunk@41288 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-22 11:11:23 +00:00
Boone Gorges
04b5965866 Introduce paged argument to WP_Comment_Query.
Using `paged` with `number` allows developers to request
paginated comment results without having to do a manual offset
calculation.

Props AdamWills.
Fixes #38268.

git-svn-id: https://develop.svn.wordpress.org/trunk@41287 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-21 15:34:19 +00:00
Drew Jaynes
7157569a72 Docs: Fix a typo in the DocBlock description for add_shortcode() introduced in [41281].
Props grapplerulrich.
See #37222.


git-svn-id: https://develop.svn.wordpress.org/trunk@41286 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 20:37:47 +00:00
Drew Jaynes
c3ff721c81 Docs: Clarify that get_comments_number() can return either a numeric string (for compatibility reasons) or 0 if the post doesn't exist.
Also update the hook doc for the `get_comments_number` filter to reflect the mixed type for `$count`.

Props kiranpotphode for the initial patch.
Fixes #38369.


git-svn-id: https://develop.svn.wordpress.org/trunk@41285 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 20:12:50 +00:00
Drew Jaynes
d8c20f3a5b Docs: Improve the return description for get_post_format_slugs() to note that the array contains slugs as both keys and values.
Props danielbachhuber.
Fixes #38611.


git-svn-id: https://develop.svn.wordpress.org/trunk@41284 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 20:02:10 +00:00
Drew Jaynes
1eb7fadef4 Docs: Clarify that the second parameter passed to a shortcode callback is the shortcode content or null, rather than the content the shortcode was found in.
See #37222.


git-svn-id: https://develop.svn.wordpress.org/trunk@41283 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 19:55:24 +00:00
Drew Jaynes
c93159d69c Shortcodes: Rename the $func parameter for add_shortcode() to $callback to improve clarity.
See #37222. See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41282 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 19:47:20 +00:00
Drew Jaynes
b90eb22176 Docs: Improve documentation for add_shortcode() by:
* Removing inline examples already listed in the Code Reference
* Improving the summary and description to explain how tag conflicts are handled
* Supplement the docs for the `$func` parameter by describing the three arguments passed to a shortcode callback.

Props grapplerulrich for the initial patch.
Fixes #37222.


git-svn-id: https://develop.svn.wordpress.org/trunk@41281 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 19:43:58 +00:00
Drew Jaynes
70134f9544 Docs: Add a note to the register_taxonomy() DocBlock that the object types defined in $object_type when modifying an already-registered taxonomy will be overwritten.
Props danielbachhuber and BjornW for the initial patches.
Fixes #34413.


git-svn-id: https://develop.svn.wordpress.org/trunk@41280 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 19:22:46 +00:00
John Blackbourn
5d068e3149 Build/Test tools: Revert [41278] because the PHP 5.2 environment on Travis doesn't support OpenSSL, hence the tests fail.
See #41676


git-svn-id: https://develop.svn.wordpress.org/trunk@41279 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 12:58:59 +00:00
John Blackbourn
dcfe7794c6 Build/Test tools: Don't skip tests which rely on OpenSSL when the openssl extension isn't loaded.
See #41676


git-svn-id: https://develop.svn.wordpress.org/trunk@41278 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 12:30:26 +00:00
Pascal Birchler
214d92191d Build/Test Tools: Remove unneeded commas to fix JSHint error introduced
in [41271].

See #30666.


git-svn-id: https://develop.svn.wordpress.org/trunk@41277 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 09:12:36 +00:00
Drew Jaynes
6ebef9f76f Docs: Improve the usefulness and accuracy of the file header for wp-cron.php.
Props stevenlinx for the initial patch.
Fixes #31401.


git-svn-id: https://develop.svn.wordpress.org/trunk@41276 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:36:39 +00:00
Drew Jaynes
8ceaf1e3a4 Docs: Add a missing return description for the deprecated get_screen_icon() function.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41275 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:03:55 +00:00
Drew Jaynes
9bf29bd7a0 Administration: Explicitly deprecate screen_icon() and get_screen_icon(), which were soft-deprecated in [26537] for 3.8.0.
Props ippei-sumida for the initial patch.
Fixes #41153.


git-svn-id: https://develop.svn.wordpress.org/trunk@41274 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 04:02:16 +00:00
Drew Jaynes
281d6c23f8 Docs: Explicitly deprecate the add_tab(), remove_tab(), and print_tab_image() methods for WP_Customize_Image_Control, originally soft-deprecated in 4.1.
Props jrf.
See #41121.


git-svn-id: https://develop.svn.wordpress.org/trunk@41273 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-20 03:37:17 +00:00
Drew Jaynes
fff123a8ea Docs: Document user object parameters for a variety of functions in wp-includes/user.php as WP_User type instead of the more generic object type.
Props sebastianpisula.
Fixes #40945.


git-svn-id: https://develop.svn.wordpress.org/trunk@41272 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-19 20:18:21 +00:00
Aaron Jorbin
7ac4e811b4 Build/Test Tools: Add banner to minified CSS files
Patches occasionally come in on generated files. We should be kind to new contributors and give them a hint that these files are auto generated.

Props drewapicture, samuelsidler, netweb, valendesigns, kpdesign, nacin, jorbin
Fixes #30666


git-svn-id: https://develop.svn.wordpress.org/trunk@41271 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-19 20:09:31 +00:00
John Blackbourn
60a3676581 Media: bring the capability check in wp_ajax_crop_image() inline with those in wp_ajax_imgedit_preview() and wp_ajax_image_editor().
This change means that a user can crop an image if they have the ability to edit its attachment post, without requiring the ability to access the Customizer.

Fixes #40193


git-svn-id: https://develop.svn.wordpress.org/trunk@41270 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-19 13:29:03 +00:00
Felix Arntz
5c12afb4e1 Multisite: Use correct capability for the Updates page in the network admin.
A user should not be required to have the `update_core` capability to access the Updates page. Having one of the update capabilities for core, plugins, themes and languages should be sufficient.

Fixes #41538.


git-svn-id: https://develop.svn.wordpress.org/trunk@41269 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-19 10:38:50 +00:00
Felix Arntz
f16b2a650e Role/Capability: Introduce capabilities dedicated to installing and updating language files.
The new meta capabilities are called `install_languages` and `update_languages`. Prior to this change, there were no proper capability checks applied. Instead only the filesystem and related constants were checked, and for actual permissions a rather vague fallback was used where a user needed to have at least one of the other updating capabilities. In addition to being generally more verbose, the new capabilities make it possible for example to allow a user to update languages, but nothing else. By default they fall back to the original way of how they were handled.

Props johnbillion, flixos90.
Fixes #39677.


git-svn-id: https://develop.svn.wordpress.org/trunk@41268 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 18:30:28 +00:00
Felix Arntz
c56dd07a30 Post Thumbnails: Pass post ID to post_thumbnail_size filter.
In addition to the enhancement, tests for the filter usage including the new parameter have been added.

Props NathanAtmoz.
Fixes #39030.


git-svn-id: https://develop.svn.wordpress.org/trunk@41267 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 18:18:51 +00:00
Konstantin Obenland
677082be4b Widgets: Add tests for retrieve_widgets().
Helps with maintaining back compat when making changes in the future.

See #39693.



git-svn-id: https://develop.svn.wordpress.org/trunk@41266 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 15:03:43 +00:00
Adam Silverstein
6530f95d49 Docs: Improve JavaScript documentation in autosave.js.
Add and improve JSDOC blocks.

Props carolinegeven.
Fixes #41203.




git-svn-id: https://develop.svn.wordpress.org/trunk@41265 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 14:23:06 +00:00
Adam Silverstein
427cec893e Docs: Improve JavaScript documentation in color-picker.js.
Add and improve JSDOC blocks.

Props carolinegeven, jjcomack, jipmoors.
Fixes #41063.




git-svn-id: https://develop.svn.wordpress.org/trunk@41264 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 13:09:45 +00:00
Gary Pendergast
e78fe9ec6d Tests: Rename ignored tests in multisite.xml.
For  bonus :yolo: :friday:, this repeats [41262] for `multisite.xml`, which duplicates the ignored file list from `phpunit.xml.dist`.

See #41658.



git-svn-id: https://develop.svn.wordpress.org/trunk@41263 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 10:59:38 +00:00
Gary Pendergast
5ee7f7dfdb Tests: Rename ignored tests in phpunit.xml.dist.
Some of the files renamed in [41261] are listed in `phpunit.xml.dist`, as they need to be ignore in PHP 5.2.

This followup commit changes `phpunit.xml.dist` to match their new names.

See #41658.



git-svn-id: https://develop.svn.wordpress.org/trunk@41262 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 10:26:50 +00:00
Gary Pendergast
243053dfd3 Tests: Rename tests with underscore in the name
There were a handful of files with an underscore in the name, which violated our naming scheme, and caused problems for anyone how enforced the scheme on their own systems.

This commit renames all of the files to the correct camelCase scheme.

Fixes #41658.



git-svn-id: https://develop.svn.wordpress.org/trunk@41261 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-18 09:57:12 +00:00
Weston Ruter
66ee109e0a Widgets: Prevent visual Text widget from decoding encoded HTML.
Also apply `the_editor_content` filters on widget `text` with `format_for_editor()` as is done for the post editor.

Amends [40631].
Props westonruter, azaozz.
See #35243.
Fixes #41596.


git-svn-id: https://develop.svn.wordpress.org/trunk@41260 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-17 23:36:53 +00:00
Andrew Ozz
e0de3f6d1c TinyMCE: Add the default link plugin without enabling it. This makes it easy for WordPress plugins to use it at places where wplink is not suitable, for example when initializing the editor from JS.
Props turtlepod.
Fixes #41590.

git-svn-id: https://develop.svn.wordpress.org/trunk@41259 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-17 21:03:55 +00:00
Drew Jaynes
0fb490ee1a Filesystem: Introduce the pre_move_uploaded_file filter.
Passing a non-null value to the filter will prevent the uploaded file from being moved to the uploads directory for any of the functions leveraging `_wp_handle_upload()`, such as `wp_handle_upload()` or `wp_handle_sideload()`.

Error reporting related to the file being moved will also be skipped.

Props ryan, Mte90.
Fixes #24603.


git-svn-id: https://develop.svn.wordpress.org/trunk@41258 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-16 21:58:12 +00:00
Drew Jaynes
cbaa63caeb Canonical: Check first before attempting to include a 'path' value in the URL in strip_fragment_from_url().
Props Mte90.
Fixes #40542.


git-svn-id: https://develop.svn.wordpress.org/trunk@41257 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-16 21:10:39 +00:00
Weston Ruter
1111c54b14 Customize: Harden color control's logic for obtaining default value to prevent JS error when non-string default supplied.
Props andreagobetti, yonivh for testing.
Fixes #37174.


git-svn-id: https://develop.svn.wordpress.org/trunk@41256 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-16 19:03:01 +00:00
John Blackbourn
9cd6551e54 Options, Meta APIs: Update the multisite unit tests after [41254], [41164], and [41163].
This moves some more previously Multisite-only tests into the main test suite, and makes small adjustments to their assertions.

See #39118, #16470, #39117


git-svn-id: https://develop.svn.wordpress.org/trunk@41255 602fd350-edb4-49c9-b593-d223f7449a82
2017-08-15 09:15:53 +00:00