Make WordPress Core

Changeset 25427


Ignore:
Timestamp:
09/13/2013 12:52:28 PM (11 years ago)
Author:
dd32
Message:

Upgrader: Allow plugins to short-circuit the package download. Props rmccue and DrewAPicture. Fixes #22378

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r25422 r25427  
    109109    function download_package($package) {
    110110
     111        /**
     112         * Filter whether to return the package.
     113         *
     114         * @since 3.7.0
     115         *
     116         * @param bool    $reply   Whether to bail without returning the package. Default is false.
     117         * @param string  $package The package file name.
     118         * @param object  $this    The WP_Upgrader instance.
     119         */
     120        $reply = apply_filters( 'upgrader_pre_download', false, $package, $this );
     121        if ( false !== $reply )
     122            return $reply;
     123
    111124        if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote?
    112125            return $package; //must be a local file..
Note: See TracChangeset for help on using the changeset viewer.