woocommerce_plugins_install_api_error хук-событиеWC 6.4.0

Action triggered when a plugin API call failed.

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

add_action( 'woocommerce_plugins_install_api_error', 'wp_kama_woocommerce_plugins_install_api_error_action', 10, 2 );

/**
 * Function for `woocommerce_plugins_install_api_error` action-hook.
 * 
 * @param string   $slug The plugin slug.
 * @param WP_Error $api  The API response.
 *
 * @return void
 */
function wp_kama_woocommerce_plugins_install_api_error_action( $slug, $api ){

	// action...
}
$slug(строка)
The plugin slug.
$api(WP_Error)
The API response.

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

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

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

PluginsHelper::install_plugins()
woocommerce_plugins_install_api_error
woocommerce/src/Admin/PluginsHelper.php 247
do_action( 'woocommerce_plugins_install_api_error', $slug, $api );

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

woocommerce/src/Admin/API/OnboardingPlugins.php 128
add_action( 'woocommerce_plugins_install_api_error', array( $this, 'log_plugins_install_api_error' ), 10, 2 );
woocommerce/src/Internal/Admin/Notes/InstallJPAndWCSPlugins.php 39
add_action( 'woocommerce_plugins_install_api_error', array( $this, 'on_install_error' ) );