Skip to content
Docs
Get RestroPress

Action

rpress_deprecated_function_run

Updated
On this page

Fires when a deprecated RestroPress function is called.

Fired by the deprecation helper at the start of its work, before any notice is triggered. Use it to log deprecated calls. Note that the argument order differs from the order of the helper function's own parameters.

Parameters#

ParameterTypeDescription
$functionstringName of the deprecated function.
$replacementstring|nullFunction that should be used instead, if given.
$versionstringRestroPress version in which the function was deprecated.

Example#

function my_log_deprecated_function( $function, $replacement, $version ) {
	error_log( sprintf( '%s is deprecated since %s, use %s', $function, $version, $replacement ) );
}
add_action( 'rpress_deprecated_function_run', 'my_log_deprecated_function', 10, 3 );

Source#

Fired from:

  • includes/rp-core-functions.php (line 2284), in _rpress_deprecated_function()

See also#

Was this page helpful?