wc_do_deprecated_action()WC 3.0.0

Runs a deprecated action with notice only if used.

Hooks from the function

Return

null. Nothing (null).

Usage

wc_do_deprecated_action( $tag, $args, $version, $replacement, $message );
$tag(string) (required)
The name of the action hook.
$args(array) (required)
Array of additional function arguments to be passed to do_action().
$version(string) (required)
The version of WooCommerce that deprecated the hook.
$replacement(string)
The hook that should have been used.
Default: null
$message(string)
A message regarding the change.
Default: null

Changelog

Since 3.0.0 Introduced.

wc_do_deprecated_action() code WC 8.6.1

function wc_do_deprecated_action( $tag, $args, $version, $replacement = null, $message = null ) {
	if ( ! has_action( $tag ) ) {
		return;
	}

	wc_deprecated_hook( $tag, $version, $replacement, $message );
	do_action_ref_array( $tag, $args );
}