upgrader_package_options хук-фильтрWP 4.3.0

Filters the package options before running an update.

See also upgrader_process_complete.


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 used by the upgrader.

  • package(строка)
    Package for update.

  • destination(строка)
    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(массив)
    Extra hook arguments.

    • action(строка)
      Type of action.
      По умолчанию: 'update'

    • type(строка)
      Type of update process. Accepts 'plugin', 'theme', or 'core'.

    • bulk(true|false)
      Whether the update process is a bulk update.
      По умолчанию: true

    • plugin(строка)
      Path to the plugin file relative to the plugins directory.

    • theme(строка)
      The stylesheet or template name of the theme.

    • language_update_type(строка)
      The language pack update type. Accepts 'plugin', 'theme', or 'core'.

    • language_update(объект)
      The language pack update offer.

Список изменений

С версии 4.3.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.