add_filter( 'wcml_is_attributes_page', 'the_callback_function' );
- ประเภท
- filter
- หมวดหมู่
- เบ็ดเตล็ด
- เวอร์ชันของ WooCommerce Multilingual
- 3.8
คำอธิบาย
เพิ่มฟิลเตอร์เพื่อตรวจสอบว่าหน้าสินค้าปัจจุบันเป็นหน้าคุณลักษณะหรือไม่ สิ่งนี้มีประโยชน์สำหรับส่วนขยาย WooCommerce ที่มีหน้าคุณลักษณะของตนเอง
อาร์กิวเมนต์
มีพารามิเตอร์หนึ่งตัวที่ส่งไปยังฟิลเตอร์นี้:- $is_attribute_page
- (bool) หน้าปัจจุบันเป็นหน้าแอตทริบิวต์หรือไม่
ตัวอย่างการใช้งาน
ตัวอย่าง
/**
* This example is extracted from the Adventure Tours Theme compatibility class in the WCML code.
*/
add_filter( 'wcml_is_attributes_page', 'is_attributes_page' );
function is_attributes_page( $is_attribute_page ){
if( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'product_attributes_extended' && isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] == 'product' ){
$is_attributes_page = true;
}
return $is_attributes_page;
}
ฮุกที่เกี่ยวข้อง
wcml_new_order_admin_email_language, translate_shipping_methods_in_package, wcml_gui_additional_box_html, wcml_current_gateway_language, wcml_variation_term_taxonomy_ids, wcml_is_variable_product, wcml_gui_additional_box_data, wcml_after_load_lock_fields_js, wcml_wc_installed_pages, wcml_not_display_single_fields_to_translate