wc_doing_it_wrong()
Wrapper for _doing_it_wrong().
Hooks from the function
Return
null
. Nothing (null).
Usage
wc_doing_it_wrong( $function, $message, $version );
- $function(string) (required)
- Function used.
- $message(string) (required)
- Message to log.
- $version(string) (required)
- Version the message was added in.
Changelog
Since 3.0.0 | Introduced. |
wc_doing_it_wrong() wc doing it wrong code WC 9.3.3
function wc_doing_it_wrong( $function, $message, $version ) { // @codingStandardsIgnoreStart $message .= ' Backtrace: ' . wp_debug_backtrace_summary(); if ( wp_doing_ajax() || WC()->is_rest_api_request() ) { do_action( 'doing_it_wrong_run', $function, $message, $version ); error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." ); } else { _doing_it_wrong( $function, $message, $version ); } // @codingStandardsIgnoreEnd }