apply_filters( $custom_field_val, $custom_field_name )
Description
Custom fields can be encoded in a format that WPML does not understand. Those fields have to be decoded and encoded before WPML can translate them. To achieve this, the wpml_decode_custom_field and wpml_encode_custom_field filters must be used. These filters can be used if there is additional custom encoding besides the ones already handled by WPML.
Arguments
$custom_field_valValue contained within field that needs to be decoded$custom_field_nameName of the field that needs to be decoded
Example Usage
add_filter( 'wpml_decode_custom_field', 'my_decode_function', 10, 2 ); function my_decode_function( $custom_field_val, $custom_field_name ) { if ( $custom_field_name === 'my-special-field' ) { $custom_field_val = my_special_decoding_function( $custom_field_val ); } return $custom_field_val; }