Commit Graph

34992 Commits

Author SHA1 Message Date
Weston Ruter 4c137392c8 Customize: Ensure a newly-added custom link nav menu item has the appropriate CSS class names.
For nav menu items of the `custom` type, their `object` should also be set to `custom`, so that the `menu-item-custom` class name will be added.

Props vishalkakadiya.
Fixes #37575.


git-svn-id: https://develop.svn.wordpress.org/trunk@38301 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 03:11:51 +00:00
Weston Ruter 99b6d24042 Docs: Update jsdoc in `customize-nav-menus.js` to remove references to Menu Customizer plugin.
Also fix `@param` for `updateAssignedLocationsInSectionTitle`.

Props gma992, westonruter.
Fixes #37520.


git-svn-id: https://develop.svn.wordpress.org/trunk@38300 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 00:55:42 +00:00
Weston Ruter 3ffa745991 Docs: Update outdated phpdoc for `WP_Customize_Manager::validate_setting_values()` to reflect changes in [37942].
Props dlh.
See #37247.
Fixes #37759.


git-svn-id: https://develop.svn.wordpress.org/trunk@38299 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 00:40:15 +00:00
Scott Taylor 2e111412f9 Comments: in `WP_Comment_Query::fill_descendants()`, `continue` if there is an empty array in the loop.
See #37416, [38297].


git-svn-id: https://develop.svn.wordpress.org/trunk@38298 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-21 06:42:44 +00:00
Scott Taylor f6fced867b Comments: in `WP_Comment_Query::fill_descendants()`, compute `count()` in the first `for` expression so that it does not run on each iteration.
Props vishalkakadiya, deremohan.
Fixes #37416.


git-svn-id: https://develop.svn.wordpress.org/trunk@38297 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-21 06:24:18 +00:00
Scott Taylor 081e51d94b Media: use `wp_get_attachment_metadata()` instead of `get_post_meta()` where appropriate.
Adds unit test.

Props JorritSchippers.
Fixes #36246.


git-svn-id: https://develop.svn.wordpress.org/trunk@38296 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-21 06:14:37 +00:00
Scott Taylor c593c6fa95 Media: `wp_get_attachment_link()` fails to output text for non-images if the attachment post doesn't have a title and `$text` (argument #5) was not passed to the func. In this case, use the filename.
Props Jonnyauk, henry.wright.
Fixes #37343.


git-svn-id: https://develop.svn.wordpress.org/trunk@38295 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 23:44:07 +00:00
Scott Taylor d911ef44dc Media: when calling `pathinfo()`, also pass a `PATHINFO_*` constant to avoid array notices for unset keys.
Props JaworskiMatt.
Fixes #37608.


git-svn-id: https://develop.svn.wordpress.org/trunk@38294 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 23:35:50 +00:00
Scott Taylor a26f7f7d28 Media: Add some docs to `media-gallery.js` RIP.
Props jipmoors.
Fixes #37717.


git-svn-id: https://develop.svn.wordpress.org/trunk@38293 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 22:58:34 +00:00
Boone Gorges 29a5d46701 Allow attachment taxonomies to be fetched as objects.
By adding the `$output` parameter to `get_attachment_taxonomies()`, the
function signature matches that of `get_object_taxonomies()`. The change
also allows for more consistent behavior when passing `output=objects`
to `get_object_taxonomies()` for the 'attachment' object type, since
the `$output` parameter is now passed through the function stack.

Props codemovement.pk.
See #37368.

git-svn-id: https://develop.svn.wordpress.org/trunk@38292 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 17:34:13 +00:00
Boone Gorges 773eb46bf8 Introduce tests for `get_attachment_taxonomies()`.
See #37368.

git-svn-id: https://develop.svn.wordpress.org/trunk@38291 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 17:24:12 +00:00
Boone Gorges 86a2c06f6f Introduce tests for `get_object_taxonomies()`.
See #37368.

git-svn-id: https://develop.svn.wordpress.org/trunk@38290 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 17:00:56 +00:00
Sergey Biryukov 4bf8693357 Docs: Correct usage examples for `wpdb::prepare()`, which should not be called statically.
Props TJNowell.
Fixes #37744.

git-svn-id: https://develop.svn.wordpress.org/trunk@38289 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 13:16:33 +00:00
Boone Gorges f05beeba8c Query: Non-scalar and negative values for 'p' should always result in a 404.
Previously, the 'p' query var was being run through `absint()`, which
caused unexpected results.

Props Akeif, kouratoras.
Fixes #33372.

git-svn-id: https://develop.svn.wordpress.org/trunk@38288 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 02:31:31 +00:00
Boone Gorges 54b51f1a26 Mail: Don't set Sender field when setting From.
[38058] changed `wp_mail()` so that it used PHPMailer's `setFrom()`
method rather than setting the From and FromName headers directly. See
behavior of setting the `Sender` field. This causes `mail` to be
called with the `-f` flag, which causes outgoing email to fail on some
server environments.

Props Clorith, iandunn, DrewAPicture.
Fixes #37736.

git-svn-id: https://develop.svn.wordpress.org/trunk@38286 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-20 02:16:54 +00:00
Boone Gorges ba9eda1a9b Tests: Move some utility classes to their own files.
Props Frank Klein.
Fixes #37523.


git-svn-id: https://develop.svn.wordpress.org/trunk@38285 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-19 15:44:37 +00:00
Sergey Biryukov f3425a50ac Docs: Fix typo in `load_plugin_textdomain()` parameter description.
Props tivnet.
See #37318.

git-svn-id: https://develop.svn.wordpress.org/trunk@38284 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-19 14:28:42 +00:00
Boone Gorges 5fabc6b769 Add wordpress-importer tests demonstrating slashed data behavior.
See #21007.

git-svn-id: https://develop.svn.wordpress.org/trunk@38283 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-19 13:26:04 +00:00
Aaron Jorbin 6f44d8c2dd Bootstrap/Load: Include Plugin API via `require_once`
Currently, auto-prepended files need to directly modify the globals in order to add filters and actions. This is a bad idea. Globals are bad. You should never directly interact with the Plugin globals.

Fixes #37707.



git-svn-id: https://develop.svn.wordpress.org/trunk@38282 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-19 04:09:55 +00:00
Aaron Jorbin 1774eb80e6 Fix jshint of Gruntfile.js
Introduced in [38276]

See #37720.


git-svn-id: https://develop.svn.wordpress.org/trunk@38281 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 20:04:16 +00:00
Scott Taylor b786d481a9 Query: use composition for `$db` in `WP_Date_Query`, removes need to import `global $wpdb` in multiple methods.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38280 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 19:47:15 +00:00
Scott Taylor bad7b66501 Query: use composition for `$db` in `WP_Query`, removes need to import `global $wpdb` in multiple methods.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38279 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 19:38:18 +00:00
Scott Taylor 8c68a5c354 Unit Tests: skip checking the value in `Tests_User:test_user_properties` for `db`. Casting to `array` is not the most elegant thing here, and various versions of PHP key protected/private fields differently when objects are cast.
See [38275], #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38278 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 19:37:23 +00:00
Boone Gorges 83c7544ef8 In `is_object_in_term()`, return error object rather than caching it.
This change prevents an error object from being stored in the cache,
and prevents notices from being thrown when plucking term IDs to put
into the relationship cache.

See #32044, #36814.

Props rpayne7264.
Fixes #37721.

git-svn-id: https://develop.svn.wordpress.org/trunk@38277 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 19:14:52 +00:00
Aaron Jorbin e1590fff09 External Libraries: Update Minified version of jquery.masonry.js
WordPress maintains the minified version of jquery.masonry.js since there is no official build, however it has been excluded from grunt's minification process. This adds a minification task to grunt, adds it to the precommit hook for JS, minifies the file, and bumps the version on jquery.masonry.min.js. The change to the non minified version was introduced in [38261].

Fixes #37720.  See #37666.


git-svn-id: https://develop.svn.wordpress.org/trunk@38276 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 18:54:41 +00:00
Scott Taylor 4e55f2248b Query: add a `protected` field, `$db`, (composition, as it were) to `WP_*_Query` classes to hold the value for the database abstraction, instead of importing the `global $wpdb` into every method that uses it. Reduces the number of global imports by 32.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38275 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 18:20:55 +00:00
Dion Hulse 1e15f01687 Requests: Update to Requests master (fb5b517) which corrects a logic inversion in the cURL transport checks.
Previously if a host had only disabled one of `curl_init()` or `curl_exec()` it wouldn't get detected correctly by Requests, which caused cURL warnings for users on an affecte dhost.

Fixes #37700 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@38274 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-18 03:47:55 +00:00
Aaron Jorbin 1bdd60ef65 Build/Test Tools: Ensure PHP 7.1 is tested on Travis.
PHP 7.1 is the next version of PHP and WordPress should support it with the first major version after 7.1 launches. This will facilitate testing. Failures on 7.1 won't necessitate builds failing while 7.1 is still in beta.

Fixes #37625.



git-svn-id: https://develop.svn.wordpress.org/trunk@38273 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-17 20:45:07 +00:00
John Blackbourn e784e65d68 Permalinks: Correct the documentation for the `get_sample_permalink` filter, and improve the documentation for the `get_sample_permalink()` function.
Props sebastian.pisula for the original patch
Fixes #37682


git-svn-id: https://develop.svn.wordpress.org/trunk@38272 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-17 18:29:47 +00:00
Dominik Schilling (ocean90) a93c94c6b2 About Page: Add release video and move images to CDN.
Props jerrysarcastic, rosso99, petya, hugobaeta, jerrysarcastic.
See #37246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38267 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-16 17:57:06 +00:00
Dominik Schilling dd92169bfe Post Thumbnails: Restore thumbnail support for media files.
* Allow to add/remove a featured image to `attachment:audio` and `attachment:video` post types, see [27657].
* Change conditionals to check for theme OR post type support.
* Add tests for #12922.

Broken in [37658].

Props flixos90, joemcgill, DrewAPicture, wonderboymusic.
See #12922.
Fixes #37658.

git-svn-id: https://develop.svn.wordpress.org/trunk@38263 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-15 19:15:48 +00:00
Aaron Jorbin 40c9dcfa80 External Libraries: Update Masonry shim to prevent error using isAnimated option
The isAnimated option throws an error and causes Masonry to stop functioning. Masonry.prototype.options is no longer defined in 3.3.2, this.options is and does the same. Masonry was updated to 3.3.2 in [37891].

Reported upstream: https://github.com/desandro/masonry-v2-3-shim/pull/1

Props stephenharris, ocean90, azaozz for testing and second sign off.
See #37666, #32802.



git-svn-id: https://develop.svn.wordpress.org/trunk@38261 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-15 18:19:18 +00:00
Dominik Schilling e8f182885a About Page: Enhance responsive images.
* Add `srcset` and `sizes` to the mobile image for streamlined updates.
* Modify the order of image candidate strings in each `srcset` to address a bug in iOS8 where the first candidate will always be selected when using `w` descriptors, see #35030.

Props joemcgill.
Fixes #37246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38257 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 19:27:22 +00:00
Dominik Schilling a0aba9dc44 Script Loader: Fix protocol-relative URLs for the `preconnect` relation type.
`wp_resource_hints()` parses the URL for the `preconnect` and `dns-prefetch` relation types to ensure correct values for both. While protocol-relative URLs are supported for `dns-prefetch`, the double slash was lost for `preconnect`.

Props swissspidy, peterwilsoncc.
Props azaozz for review.
Fixes #37652.

git-svn-id: https://develop.svn.wordpress.org/trunk@38255 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 18:34:12 +00:00
Drew Jaynes 19a85950ad Docs: Add a period missed in an argument description in [38253] for #36338.
git-svn-id: https://develop.svn.wordpress.org/trunk@38254 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 17:43:42 +00:00
Drew Jaynes 77aa4a8b72 Docs: Add documentation for all arguments accepted by `export_wp()`.
Props theMikeD for the initial patch.
Fixes #36338.


git-svn-id: https://develop.svn.wordpress.org/trunk@38253 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 17:42:05 +00:00
Aaron Jorbin 17afb9c704 Bootstrap/Load: Revert Plugin Global restoration around `advance-cache.php`.
First added in [37588] and later modified in [38224], the idea was to ensure that filters/actions added before `advance-cache.php` would not disappear if `advance-cache.php` overloaded the filters/actions with code such as `$wp_filter = array()`. This is an edge case and one that there is no documented case of existing.

This restores the behavior from WordPress 4.5 and before. It is strongly encouraged that developers using `advance-cache.php` to use the Plugins API that is available before the loading of `advance-cache.php` rather than directly interacting with any of the globals.

Props azaozz, jorbin, dd32 for review, pento for review, westi for investigation, ipstenu for research.
See #36819.



git-svn-id: https://develop.svn.wordpress.org/trunk@38251 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-13 15:59:03 +00:00
Sergey Biryukov 363d8ad2a6 Users: Merge two duplicate strings introduced in [37940].
Props dimadin.
Fixes #37644.

git-svn-id: https://develop.svn.wordpress.org/trunk@38250 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-12 14:11:58 +00:00
Dominik Schilling 97c4e332b5 About Page: Fix punctuation errors in two strings.
See #37246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38248 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-11 20:50:38 +00:00
Dominik Schilling defc92a66e About Page: Third pass for 4.6.
* Adjust strings.
* Make strings translatable.
* Improve margin between copy and images.

Props Ipstenu, SergeyBiryukov, Presskopp, jeremyfelt, afragen, helen, Clorith, macmanx, DrewAPicture, voldemortensen, jorbin, MattyRob, ocean90.
See #37246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38244 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-10 23:32:27 +00:00
Dominik Schilling 1ca2426e77 Upgrader: Rename `class-wp-automatic-upgrader.php` to `class-wp-automatic-updater.php`.
The class is named `WP_Automatic_Updater` not `WP_Automatic_Upgrader` like all the other upgrader classes. 

Introduced in [37409].
See #37628.

git-svn-id: https://develop.svn.wordpress.org/trunk@38242 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-10 19:50:18 +00:00
Andrew Ozz a0a6262f17 Update/Install error messages: do not escape from the template, escape the error message string before inserting it.
Props swissspidy, ocean90.
Fixes #37623 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@38240 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-10 19:02:09 +00:00
Sergey Biryukov a9717f8ef0 Docs: Replace some more HTTP links with HTTPS.
Props johnpgreen.
Fixes #37622. See #36993.

git-svn-id: https://develop.svn.wordpress.org/trunk@38239 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-10 16:09:54 +00:00
Drew Jaynes fbb173fe7c Update/Install: Provide basic back-compat styling for the `.update-message` CSS class in the plugins list table.
This change restores only the margin and padding styles for the `.update-message` class when used by plugins in the context of adding arbitrary rows to the list table. The inline-update colors and icon styles were not restored, expressly with a wide variety of plugin use-cases in mind.

Props ovann86, rahulsprajapati, ocean90, DrewAPicture.
Props helen for review.
See #37504.


git-svn-id: https://develop.svn.wordpress.org/trunk@38237 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 22:44:07 +00:00
Dominik Schilling 3844065c1a Media: In `_wp_handle_upload()` use `call_user_func_array()` to call the upload error handler.
The default error handler `wp_handle_upload_error()` expects a reference for the first parameter but `call_user_func()` doesn't pass parameters by reference. The current code didn't produce any issues until now. PHP 7.0.9 (and PHP 7.1) is now stricter and prevents calling the error handler with a warning:
> PHP Warning:  Parameter 1 to wp_handle_upload_error() expected to be a reference, value given.

To restore the error handler `_wp_handle_upload()` now uses `call_user_func_array()`.

Props jbrinley.
Props jorbin for review.
Fixes #37570.

git-svn-id: https://develop.svn.wordpress.org/trunk@38235 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 21:53:12 +00:00
Dominik Schilling 6c18bf7e3f About Page: Update video for streamlined updates and add `srcset`/`sizes` attributes for the static images.
Props hugobaeta, joemcgill.
See #37246.

git-svn-id: https://develop.svn.wordpress.org/trunk@38234 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 19:25:14 +00:00
Jeremy Felt 3a00f2eb3d Multisite: Remove unnecessary reference parameters.
There is no advantage to passing parameters by reference to `get_site()`, `get_network()`, and `update_site_cache()`.

Props flixos90, ocean90 for review.
See #37615.


git-svn-id: https://develop.svn.wordpress.org/trunk@38232 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 18:11:12 +00:00
Sergey Biryukov 5e99f1ef34 Embeds: Fix copy/paste error in `WP_oEmbed::_add_provider_early()` description.
Props ivantedja.
Fixes #37602.

git-svn-id: https://develop.svn.wordpress.org/trunk@38230 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 14:10:00 +00:00
Gary Pendergast cfafcf3997 Multisite: Improve performance of the upgrade page on large networks.
The query to select the next 5 blogs to upgrade was ordered by `registered`, which isn't indexed. This causes the query to table scan, which will be slow on networks with many blogs.

The query only needs to be ordered by something that won't change, so ordering by `blog_id` is a good replacement. `blog_id` is indexed, and it's the only column being returned, so MySQL is able to optimize for a fast index read.

Props fliespl.
Fixes #37612.



git-svn-id: https://develop.svn.wordpress.org/trunk@38229 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 11:38:41 +00:00
Dominik Schilling ff416b77f3 Updates: Add visual feedback when deleting themes/plugins.
This corrects the selector for the delete link in `wp.updates.deletePlugin()` so the text can be changed to 'Deleting…'. `wp.updates.deleteTheme()` already worked on wp-admin/themes.php but not on wp-admin/network/themes.php because the network screen is similar to the plugins list table, this is now fixed too.
The `credential-modal-cancel` handler has been updated to support canceled delete jobs.

Props swissspidy.
Props jorbin for review.
Fixes #37603.

git-svn-id: https://develop.svn.wordpress.org/trunk@38227 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-09 10:38:28 +00:00