_deprecated_argument


_deprecated_argument ( $function, $version, $message = null )

Access:
  • private
Parameters:
  • (string) $function The function that was called.
  • (string) $version The version of WordPress that deprecated the argument used.
  • (string) $message Optional. A message regarding the change. Default null.
Defined at:

Description

Mark a function argument as deprecated and inform when it has been used.

This function is to be used whenever a deprecated function argument is used. Before this function is called, the argument must be checked for whether it was used by comparing it to its default value or evaluating whether it is empty. For example:

if ( ! empty( $deprecated ) ) {
    _deprecated_argument( __FUNCTION__, '3.0.0' );
}

There is a hook deprecated_argument_run that will be called that can be used to get the backtrace up to what file and function used the deprecated argument.

The current behavior is to trigger a user error if WP_DEBUG is true.

Related Functions

rest_handle_deprecated_argument, _deprecated_function, _deprecated_file, _deprecated_hook, _deprecated_constructor

Top Google Results

User discussions

wpseek mobile