You appear to be a bot. Output may be restricted
Description
Marks an argument in a function deprecated and informs when it's been used
There is a hook edd_deprecated_argument_run that will be called that can be used to get the backtrace up to what file and function called the deprecated function. The current behavior is to trigger a user error if WP_DEBUG is true. This function is to be used in every function that has an argument being deprecated.
Usage
_edd_deprected_argument( $argument, $function, $version, $replacement, $backtrace );
Parameters
- $argument
- ( string ) required – The arguemnt that is being deprecated
- $function
- ( string ) required – The function that was called
- $version
- ( string ) required – The version of WordPress that deprecated the function
- $replacement
- ( string ) optional – Optional. The function that should have been called
- $backtrace
- ( array ) optional – Optional. Contains stack backtrace of deprecated function
Returns
void
Source
File name: easy-digital-downloads/includes/misc-functions.php
Lines:
1 to 18 of 18
function _edd_deprected_argument( $argument, $function, $version, $replacement = null, $backtrace = null ) { do_action( 'edd_deprecated_argument_run', $argument, $function, $replacement, $version ); $show_errors = current_user_can( 'manage_options' ); // Allow plugin to filter the output error trigger if ( WP_DEBUG && apply_filters( 'edd_deprecated_argument_trigger_error', $show_errors ) ) { if ( ! is_null( $replacement ) ) { trigger_error( sprintf( __( 'The %1$s argument of %2$s is <strong>deprecated</strong> since Easy Digital Downloads version %3$s! Please use %4$s instead.', 'easy-digital-downloads' ), $argument, $function, $version, $replacement ) ); trigger_error( print_r( $backtrace, 1 ) ); // Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. // Alternatively we could dump this to a file. } else { trigger_error( sprintf( __( 'The %1$s argument of %2$s is <strong>deprecated</strong> since Easy Digital Downloads version %3$s with no alternative available.', 'easy-digital-downloads' ), $argument, $function, $version ) ); trigger_error( print_r( $backtrace, 1 ) );// Limited to previous 1028 characters, but since we only need to move back 1 in stack that should be fine. // Alternatively we could dump this to a file. } } }