WordPress at Your Fingertips
function is not described

wc_deprecated_hook() WC 3.3.0

Wrapper for deprecated hook so we can apply some extra logic.

Hooks from the function

Return

null. Nothing.

Usage

wc_deprecated_hook( $hook, $version, $replacement, $message );
$hook(string) (required)
The hook that was used.
$version(string) (required)
The version of WordPress 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.3.0 Introduced.

Code of wc_deprecated_hook() WC 5.8.0

function wc_deprecated_hook( $hook, $version, $replacement = null, $message = null ) {
	// @codingStandardsIgnoreStart
	if ( is_ajax() || WC()->is_rest_api_request() ) {
		do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message );

		$message    = empty( $message ) ? '' : ' ' . $message;
		$log_string = "{$hook} is deprecated since version {$version}";
		$log_string .= $replacement ? "! Use {$replacement} instead." : ' with no alternative available.';

		error_log( $log_string . $message );
	} else {
		_deprecated_hook( $hook, $version, $replacement, $message );
	}
	// @codingStandardsIgnoreEnd
}