wc_do_deprecated_action( string $tag, array $args, string $version, string $replacement = null, string $message = null )

Runs a deprecated action with notice only if used.

Description Description

Parameters Parameters


(Required) The name of the action hook.


(Required) Array of additional function arguments to be passed to do_action().


(Required) The version of WooCommerce that deprecated the hook.


(Optional) The hook that should have been used.

Default value: null


(Optional) A message regarding the change.

Default value: null

Top ↑

Source Source

File: includes/wc-deprecated-functions.php

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

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

Top ↑

Changelog Changelog

Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.