تابع ووکامرسی wc_print_js نمایش هر کد جاوا اسکریپت در footer

تابع ووکامرسی wc_print_js – نمایش هر کد جاوا اسکریپتی که در صف footer در نظر گرفته شده است
Syntax – سینتکس
wc_print_js();
Usage – نحوه استفاده
if ( !function_exists( 'wc_print_js' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php';
}
// NOTICE! Understand what this does before running.
$result = wc_print_js();
Defined – محل تعریف
/includes/wc-core-functions.php
function wc_print_js() {
global $wc_queued_js;
if ( ! empty( $wc_queued_js ) ) {
// Sanitize.
$wc_queued_js = wp_check_invalid_utf8( $wc_queued_js );
$wc_queued_js = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", $wc_queued_js );
$wc_queued_js = str_replace( "\r", '', $wc_queued_js );
$js = "\n\n";
/**
* woocommerce_queued_js filter.
*
* @since 2.6.0
* @param string $js JavaScript code.
*/
echo apply_filters( 'woocommerce_queued_js', $js );
unset( $wc_queued_js );
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر