Skip to content
Docs
Get RestroPress

Action

rpress_deprecated_argument_run

Updated
On this page

Fires when a function is called with a deprecated argument.

Fired by the deprecated-argument helper before any notice is triggered. Use it to log such calls. The argument order differs from the order of the helper function's own parameters.

Parameters#

ParameterTypeDescription
$argumentstringName of the deprecated argument.
$functionstringFunction that was called.
$replacementstring|nullReplacement to use, if given.
$versionstringRestroPress version in which the argument was deprecated.

Example#

function my_log_deprecated_argument( $argument, $function, $replacement, $version ) {
	error_log( sprintf( 'Argument %s of %s is deprecated since %s', $argument, $function, $version ) );
}
add_action( 'rpress_deprecated_argument_run', 'my_log_deprecated_argument', 10, 4 );

Source#

Fired from:

  • includes/rp-core-functions.php (line 2334), in _rpress_deprected_argument()

See also#

Was this page helpful?