wc_deprecated_argument

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

Description

wc_deprecated_argument( (string) $argument, (string) $version, (null) $message = null ); 

Parameters (3)

0. $argument (string)
The argument.
1. $version (string)
The version.
2. $message — Optional. (null) => null
The message.

Usage

  1. if ( !function_exists( 'wc_deprecated_argument' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-deprecated-functions.php'; 
  3.  
  4. // The argument. 
  5. $argument = ''; 
  6.  
  7. // The version. 
  8. $version = ''; 
  9.  
  10. // The message. 
  11. $message = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wc_deprecated_argument($argument, $version, $message); 
  15.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-deprecated-functions.php  
  1. function wc_deprecated_argument( $argument, $version, $message = null ) { 
  2. if ( is_ajax() ) { 
  3. do_action( 'deprecated_argument_run', $argument, $message, $version ); 
  4. error_log( "The {$argument} argument is deprecated since version {$version}. {$message}" ); 
  5. } else { 
  6. _deprecated_argument( $argument, $version, $message );