WPML
add_filter( 'wcml_js_lock_fields_input_names', 'the_callback_function' );
ประเภท
filter
เวอร์ชันของ WooCommerce Multilingual
3.8

คำอธิบาย

เพิ่มหรือลบชื่ออินพุตฟิลด์กำหนดเองที่ถูกล็อกบนตัวแก้ไขสินค้าดั้งเดิมของ WooCommerce สำหรับสินค้าที่แปลแล้ว

อาร์กิวเมนต์

มีพารามิเตอร์เพียงตัวเดียวที่ส่งไปยังตัวกรองนี้:
$names
(array) อาร์เรย์ที่รวมชื่ออินพุตฟิลด์ที่กำหนดเอง

ตัวอย่างการใช้งาน

ตัวอย่าง
/**
 * Add this code to the functions.php file of your theme.
 */
add_filter( 'wcml_js_lock_fields_input_names', 'add_js_lock_fields_input_names' );

function add_js_lock_fields_input_names( $names ){

	// Add 2 locked field input names
	$names[] = '_base_regular_price';
	$names[] = 'bto_style';

	return $names;
}

wcml_after_duplicate_product_post_meta, wcml_update_extra_fields, wcml_js_lock_fields_ids, wcml_js_lock_fields_classes, wcml_before_sync_product, wcml_before_sync_product_data

ฮุก การอัปเดตเนื้อหา ทั้งหมด 7 รายการ →