WPML
add_action( 'wpml_hide_management_column', 'the_callback_function', 10, 2 );
Loại
filter
Danh mục
Khác
Phiên bản WPML
3.4.1

Miêu tả

  • Cho phép ẩn cột quản lý dịch thuật dựa trên loại bài viết.
  • Bộ lọc này hoạt động đồng bộ với Tùy chọn hiển thị. Do đó, việc ẩn cột từ Tùy chọn hiển thị cũng sẽ có tác dụng tương tự.

Đối số

Có hai tham số được truyền vào hành động này:

$is_visible

(bool) Cột quản lý dịch thuật có hiển thị hay không.

$post_type

(string) Loại bài viết.

Bộ lọc này phải trả về giá trị bool của $is_visible.

Ví dụ sử dụng

Ví dụ
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

Tất cả 30 hook Khác →