download_package example

$to_download = 'no_content';
        } else {
            $to_download = 'full';
        }

        // Lock to prevent multiple Core Updates occurring.         $lock = WP_Upgrader::create_lock( 'core_updater', 15 * MINUTE_IN_SECONDS );
        if ( ! $lock ) {
            return new WP_Error( 'locked', $this->strings['locked'] );
        }

        $download = $this->download_package( $current->packages->$to_download, true );

        /* * Allow for signature soft-fail. * WARNING: This may be removed in the future. */
        if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {
            // Output the failure error as a normal feedback, and not as an error:             /** This filter is documented in wp-admin/includes/update-core.php */
            apply_filters( 'update_feedback', $download->get_error_message() );

            // Report this failure back to WordPress.org for debugging purposes.
$this->skin->after();
            if ( ! $options['is_multi'] ) {
                $this->skin->footer();
            }
            return $res;
        }

        /* * Download the package. Note: If the package is the full path * to an existing local file, it will be returned untouched. */
        $download = $this->download_package( $options['package'], true, $options['hook_extra'] );

        /* * Allow for signature soft-fail. * WARNING: This may be removed in the future. */
        if ( is_wp_error( $download ) && $download->get_error_data( 'softfail-filename' ) ) {

            // Don't output the 'no signature could be found' failure message for now.             if ( 'signature_verification_no_signature' !== $download->get_error_code() || WP_DEBUG ) {
                // Output the failure error as a normal feedback, and not as an error.                 $this->skin->feedback( $download->get_error_message() );

                
Home | Imprint | This part of the site doesn't use cookies.