wsf_translate

Description

The wsf_translate filter hook is called whenever WS Form translates a string related to a form such as:

  • Form settings
  • Tab settings
  • Section settings
  • Field settings
  • Action settings

This filter hook is only available if the wsf_translate_load filter hook returns true. It will also be present if compatible translation plugins such as WPML or Polylang are installed.

Usage

add_filter( 'wsf_translate', 'my_hook_function', 10, 4 );

Parameters

  1. $string_value String
    The string being translated
  2. $string_name String
    A unique identifier for the string
  3. $form_id Integer
    The form ID
  4. $form_label String
    The form label

Example

// Callback function for the wsf_translate filter hook
function my_hook_function( $string_value, $string_name, $form_id, $form_label ) {
	
	// Your code here ...

	// Return value
	return $string_value;
}

// Add a callback function for the wsf_translate filter hook
add_filter( 'wsf_translate', 'my_hook_function', 10, 4 );

Source File

This hook can be found in: <plugin root>/includes/core/class-ws-form-translate.php