upgrader_package_options filter-hookWP 4.3.0

Filters the package options before running an update.

See also upgrader_process_complete.

Usage

add_filter( 'upgrader_package_options', 'wp_kama_upgrader_package_options_filter' );

/**
 * Function for `upgrader_package_options` filter-hook.
 * 
 * @param array $options Options used by the upgrader.
 *
 * @return array
 */
function wp_kama_upgrader_package_options_filter( $options ){

	// filter...
	return $options;
}
$options(array)

Options used by the upgrader.

  • package(string)
    Package for update.

  • destination(string)
    Update location.

  • clear_destination(true|false)
    Clear the destination resource.

  • clear_working(true|false)
    Clear the working resource.

  • abort_if_destination_exists(true|false)
    Abort if the Destination directory exists.

  • is_multi(true|false)
    Whether the upgrader is running multiple times.

  • hook_extra(array)
    Extra hook arguments.

    • action(string)
      Type of action.
      Default: 'update'

    • type(string)
      Type of update process. Accepts 'plugin', 'theme', or 'core'.

    • bulk(true|false)
      Whether the update process is a bulk update.
      Default: true

    • plugin(string)
      Path to the plugin file relative to the plugins directory.

    • theme(string)
      The stylesheet or template name of the theme.

    • language_update_type(string)
      The language pack update type. Accepts 'plugin', 'theme', or 'core'.

    • language_update(object)
      The language pack update offer.

Changelog

Since 4.3.0 Introduced.

Where the hook is called

WP_Upgrader::run()
upgrader_package_options
wp-admin/includes/class-wp-upgrader.php 796
$options = apply_filters( 'upgrader_package_options', $options );

Where the hook is used in WordPress

Usage not found.