Filter hook 'upgrader_package_options'

in WP Core File wp-admin/includes/class-wp-upgrader.php at line 818

View Source

upgrader_package_options

Filter Hook
Description
Filters the package options before running an update. See also {@see 'upgrader_process_complete'}. Extra hook arguments. or 'core'. } }

Hook Information

File Location wp-admin/includes/class-wp-upgrader.php View on GitHub
Hook Type Filter
Line Number 818

Hook Parameters

Type Name Description
array $options { Options used by the upgrader.

Usage Examples

Basic Usage
<?php
// Hook into upgrader_package_options
add_filter('upgrader_package_options', 'my_custom_filter', 10, 1);

function my_custom_filter($options) {
    // Your custom filtering logic here
    return $options;
}

Source Code Context

wp-admin/includes/class-wp-upgrader.php:818 - How this hook is used in WordPress core
<?php
 813  		 *                                            or 'core'.
 814  		 *         @type object $language_update      The language pack update offer.
 815  		 *     }
 816  		 * }
 817  		 */
 818  		$options = apply_filters( 'upgrader_package_options', $options );
 819  
 820  		if ( ! $options['is_multi'] ) { // Call $this->header separately if running multiple times.
 821  			$this->skin->header();
 822  		}
 823  

PHP Documentation

<?php
/**
		 * Filters the package options before running an update.
		 *
		 * See also {@see 'upgrader_process_complete'}.
		 *
		 * @since 4.3.0
		 *
		 * @param array $options {
		 *     Options used by the upgrader.
		 *
		 *     @type string $package                     Package for update.
		 *     @type string $destination                 Update location.
		 *     @type bool   $clear_destination           Clear the destination resource.
		 *     @type bool   $clear_working               Clear the working resource.
		 *     @type bool   $abort_if_destination_exists Abort if the Destination directory exists.
		 *     @type bool   $is_multi                    Whether the upgrader is running multiple times.
		 *     @type array  $hook_extra {
		 *         Extra hook arguments.
		 *
		 *         @type string $action               Type of action. Default 'update'.
		 *         @type string $type                 Type of update process. Accepts 'plugin', 'theme', or 'core'.
		 *         @type bool   $bulk                 Whether the update process is a bulk update. Default true.
		 *         @type string $plugin               Path to the plugin file relative to the plugins directory.
		 *         @type string $theme                The stylesheet or template name of the theme.
		 *         @type string $language_update_type The language pack update type. Accepts 'plugin', 'theme',
		 *                                            or 'core'.
		 *         @type object $language_update      The language pack update offer.
		 *     }
		 * }
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/class-wp-upgrader.php
Related Hooks

Related hooks will be displayed here in future updates.