WPML
add_filter( 'wcml_wc_installed_pages', 'the_callback_function', 10, 1 );
Loại
filter
Danh mục
Khác
Phiên bản WooCommerce Multilingual
3.5

Miêu tả

Thêm hoặc xóa các tên tùy chọn trang WooCommerce được sử dụng trong WPML Multilingual & Đa tiền tệ cho WooCommerce.

Đối số

Chỉ có một tham số được truyền cho bộ lọc này: page_option_names.
$page_option_names
(array) Mảng tên tùy chọn trang trông như sau:
array( 'woocommerce_shop_page_id', 'woocommerce_cart_page_id', 'woocommerce_checkout_page_id', 'woocommerce_myaccount_page_id' )

Ví dụ sử dụng

Ví dụ
/**
 * Add this code to the functions.php file of your theme.
 */
 
add_filter( 'wcml_wc_installed_pages', 'add_wc_installed_pages', 10, 1 );
 
function add_wc_installed_pages( $page_option_names ) {
     
    // A new page option name 
    $page_option_names[] = 'woocommerce_custom_page_id'; 
    return $page_option_names;
}

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_attributes_page, wcml_is_variable_product, wcml_gui_additional_box_data, wcml_after_load_lock_fields_js, wcml_not_display_single_fields_to_translate

Tất cả 12 hook Khác →