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

คำอธิบาย

เพิ่มหรือลบ ID ของฟิลด์กำหนดเองที่ถูกล็อกในตัวแก้ไขผลิตภัณฑ์ดั้งเดิมของ WooCommerce สำหรับผลิตภัณฑ์ที่แปลแล้ว

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

มีพารามิเตอร์เพียงตัวเดียวที่ส่งไปยังฟิลเตอร์นี้
$ids
(array) อาร์เรย์ที่รวม ID ของฟิลด์กำหนดเอง

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

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

function add_js_lock_fields_ids( $ids ){

	// Add 2 locked field IDs
	$ids[] = '_per_product_pricing_bto';
	$ids[] = '_per_product_shipping_bto';

	return $ids;
}

wcml_after_duplicate_product_post_meta, wcml_update_extra_fields, wcml_js_lock_fields_input_names, wcml_js_lock_fields_classes, wcml_before_sync_product, wcml_before_sync_product_data

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