Commit Graph

34958 Commits

Author SHA1 Message Date
Scott Taylor
459f3aa9a3 Users: $user_level has been publicly-accessed on instances of WP_User since version 2.0, but is has never been declared.
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38317 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 21:40:35 +00:00
Scott Taylor
03aad23a01 Locale: declare the $month_genitive field on WP_Locale.
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38316 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 21:32:09 +00:00
Scott Taylor
6f19452077 HTTP: in WP_HTTP_Response, the @param declarations for $status and $headers were swapped. Let us correct this.
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38315 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 21:27:02 +00:00
Scott Taylor
670878cbaa Database: WP_Network, WP_Network_Query, and WP_Site_Query call wpdb::_escape(), thus requiring it to be public. It previously had no access modifier. _ at the beginning of a method, believe it or not, does not enforce visibility constraints.
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38314 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 21:09:03 +00:00
Scott Taylor
6df9616ff6 Comments: in wp_handle_comment_submission(), $_wp_unfiltered_html_comment is passed as part of $comment_data, but is not used locally.
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38313 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 21:03:05 +00:00
Scott Taylor
d46de8b22b Taxonomy: remove unnecessary break in WP_Term::__get().
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38312 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 20:59:35 +00:00
Scott Taylor
46d7304d4a Nav Menus: remove unnecessary variable assignment in wp_nav_menu_item_post_type_meta_box().
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38311 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 20:57:41 +00:00
Scott Taylor
368e28243f REST API: remove unnecessary variable assignments in rest_handle_options_request().
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38310 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 20:55:29 +00:00
Scott Taylor
0dcc38a1ef Media: remove unnecessary variable assignment in gallery_shortcode().
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38309 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 20:52:44 +00:00
Scott Taylor
0774c039f4 General: remove variable set needlessly in wp_check_jsonp_callback().
See #37771.


git-svn-id: https://develop.svn.wordpress.org/trunk@38308 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 20:50:31 +00:00
Drew Jaynes
b4fca4a558 Hooks: Standardize naming of dynamic hooks to use interpolation vs concatenation.
Benefits gained in discoverability and self-documentation throughout core trump the negligible performance hit in using interpolation in hook names.

Props ramiy.
See #37748.


git-svn-id: https://develop.svn.wordpress.org/trunk@38307 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 18:24:48 +00:00
Sergey Biryukov
f9491ed8f6 Common CSS: Allow for .nav-tab-wrapper class to be used on elements other than h3 to increase flexibility for custom settings pages.
Props ramiy, afercia.
Fixes #37257.

git-svn-id: https://develop.svn.wordpress.org/trunk@38306 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 16:32:11 +00:00
Sergey Biryukov
8673ec7459 Multisite: Fix copy/paste issue in id attribute for a dismissible message on Sites screen.
Props imath.
Fixes #37764.

git-svn-id: https://develop.svn.wordpress.org/trunk@38305 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 14:21:15 +00:00
Scott Taylor
92d8f4afdc Login: retrieve_password() does not need to import 2 globals that it does not use.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38304 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 04:47:19 +00:00
Scott Taylor
45cd115bf6 Media: add a function, wp_get_additional_image_sizes(), that wraps the retrieval of the global $_wp_additional_image_sizes. Removes 6 global imports.
See #37699.


git-svn-id: https://develop.svn.wordpress.org/trunk@38303 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 04:36:42 +00:00
Scott Taylor
e878e8156b Media: fix unit test after [38296].
https://en.wikipedia.org/wiki/Coupling_(computer_programming)#Disadvantages

Fixes #36246.


git-svn-id: https://develop.svn.wordpress.org/trunk@38302 602fd350-edb4-49c9-b593-d223f7449a82
2016-08-22 04:16:29 +00:00
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