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
[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
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
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
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
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
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
* 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
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
* 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
`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
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
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
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
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
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
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
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
Introduced in [37972]. The title for the Quick Draft widget contains HTML to provide a JS/no-JS version.
Props SergeyBiryukov for review.
See #37595.
Fixes#37594.
git-svn-id: https://develop.svn.wordpress.org/trunk@38225 602fd350-edb4-49c9-b593-d223f7449a82
[37588] added methods to backup the plugin globals, for ensuring that advanced cache drop-ins don't overwrite hooks that've been added earlier in the load process.
The method for restoring the plugin globals wasn't compatible with the implementation of `WP_Hook` in #17817. `WP_Hook` implements `ArrayAccess`, so `_restore_plugin_globals()` was treating it as an array, and inadvertantly overwriting the `WP_Hook` object with a plain array.
To avoid having to re-write this code as part of #17817, we now use `add_filter()` to restore any hooks that were added by cache drop-ins, which `WP_Hook` correctly supports.
Props pento, jorbin.
See #36819.
git-svn-id: https://develop.svn.wordpress.org/trunk@38223 602fd350-edb4-49c9-b593-d223f7449a82
Before this change, when a bulk update was canceled due dismissing the FTP credentials modal, part of the actions didn't get canceled. This meant the "There is a new version of…” notices become blank and the updates you had checked became unchecked. Now, the notices remain and you are essentially returned to the screen you had before. Strings are also updated to improve ARIA usage.
Fixes#37563.
Props ocean90, swissspidy, obenland, afercia.
git-svn-id: https://develop.svn.wordpress.org/trunk@38221 602fd350-edb4-49c9-b593-d223f7449a82
Custom JS events are triggered on the document in order for plugins to have something to hook into. The standard began in #31819 is dash separated and begins with `wp` to signify the namespace, followed by the subject of our action ( "theme", "plugin", etc.) followed by the action and an optional indicator of status ( "install-success", "deleting" ).
This brings some of the theme hooks in line with the standard. As of now, all plugin actions in `src/wp-admin/js/updates.js` have an equal corresponding theme action.
Fixes#37598.
See #37512, #37216, #31819.
Props olarmarius, ocean90.
git-svn-id: https://develop.svn.wordpress.org/trunk@38218 602fd350-edb4-49c9-b593-d223f7449a82
The global `$current_blog` is not switched in `switch_to_blog()` and can
not be used to properly retrieve current switched site information.
See #37607.
git-svn-id: https://develop.svn.wordpress.org/trunk@38217 602fd350-edb4-49c9-b593-d223f7449a82
[37262] changed a check in `redirect_canonical()` so that it checked
categories in the object cache rather than querying the database. However,
the check was based on the identity of `WP_Term` objects, which in
certain cases can be augmented by the main WP query routine, causing
failures of the `in_array()` check. This caused unnecessary redirects
for URLs where `is_single()` is true, but the URL is different from the
post permalink, such as the `embed` endpoint.
`has_term()` also checks the cache, but does not sufer from this bug.
Props cmillerdev.
Fixes#36602.
git-svn-id: https://develop.svn.wordpress.org/trunk@38216 602fd350-edb4-49c9-b593-d223f7449a82
The previous version had the wrong colors. Also remove ogv from the list, it has the wrong colors too and all current browsers support either the mp4 or webm format.
See #37246.
git-svn-id: https://develop.svn.wordpress.org/trunk@38215 602fd350-edb4-49c9-b593-d223f7449a82