Skip Navigation
availability:

WooCommerce Multilingual Version: 3.8

description:

Add or remove custom field classes that are locked on the WooCommerce native product editor of translated products.

type:
filter
category:
Updating Content
parameters:
add_filter( 'wcml_js_lock_fields_classes', 'the_callback_function' );

There is only one parameter passed to this filter:

$classes
(array) The array including custom field classes.
hook example usage:

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * Add this code to the functions.php file of your theme.
 */
add_filter( 'wcml_js_lock_fields_classes', 'add_js_lock_fields_classes' );
 
function add_js_lock_fields_classes( $classes ){
 
    // Add 2 locked field classes
    $classes[] = '_per_product_pricing_bto';
    $classes[] = '_per_product_shipping_bto';
 
    return $classes;
}