تابع ووکامرسی wc_doing_it_wrong افزودن پیغام خطا در نحوه فراخوانی تابع

تابع ووکامرسی wc_doing_it_wrong – افزودن پیغام خطا در نحوه فراخوانی تابع
Syntax – سینتکس
wc_doing_it_wrong( (string) $function, (string) $message, (string) $version );
Parameters – پارامتر ها (3)
- 1- $function (string)
- 2- $message (string)
- 3- $version (string)
Usage – نحوه استفاده
if ( !function_exists( 'wc_doing_it_wrong' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-deprecated-functions.php';
}
// The function.
$function = '';
// The message.
$message = '';
// The version.
$version = '';
// NOTICE! Understand what this does before running.
$result = wc_doing_it_wrong($function, $message, $version);
Defined – محل تعریف
/includes/wc-deprecated-functions.php
function wc_doing_it_wrong( $function, $message, $version ) {
$message .= ' Backtrace: ' . wp_debug_backtrace_summary();
if ( is_ajax() ) {
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 );
}
}
versions – نسخه ها
از نسخه : 3.0.0
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر