add_action( 'wpml_hide_management_column', 'the_callback_function', 10, 2 );
- ประเภท
- filter
- หมวดหมู่
- เบ็ดเตล็ด
- เวอร์ชันของ WPML
- 3.4.1
คำอธิบาย
- ช่วยให้สามารถซ่อนคอลัมน์การจัดการการแปลตามประเภทโพสต์ได้
- ฟิลเตอร์นี้ทำงานสอดคล้องกับ ตัวเลือกหน้าจอ ดังนั้น การซ่อนคอลัมน์จากตัวเลือกหน้าจอจะมีผลเช่นเดียวกัน
อาร์กิวเมนต์
มีพารามิเตอร์ 2 ตัวที่ส่งไปยัง action นี้:- $is_visible
- (bool) คอลัมน์การจัดการการแปลจะแสดงหรือไม่
- $post_type
- (string) ประเภทโพสต์
ฟิลเตอร์นี้ต้องส่งคืนค่า bool ของ $is_visible
ตัวอย่างการใช้งาน
ตัวอย่าง
add_filter( 'wpml_hide_management_column', array( $this, 'my_filter_function' ), 10, 2 );
/**
* Hide management column by default for products.
*
*/
function my_filter_function( $is_visible, $post_type ) {
if ( 'product' === $post_type ) {
$is_visible = false;
}
return $is_visible;
}
ฮุกที่เกี่ยวข้อง
icl_ls_languages, wpml_sync_custom_field_copied_value, wpml_ls_enable_ajax_navigation, wpml_element_type, wpml_setting, wpml_sub_setting, wpml_exclude_post_from_auto_translate, wpml_forms_config_ninja-forms, wpml_forms_config_wpforms, wpml_tf_feedback_open_link