$step ) { if ( ! is_array( $step ) || 'send' !== ( $step['type'] ?? '' ) ) { continue; } foreach ( self::fields() as $f ) { $v = trim( (string) ( $step[ $f ] ?? '' ) ); if ( '' === $v ) { continue; } do_action( 'wpml_register_single_string', self::DOMAIN, self::string_name( $wf_id, $i, $f ), $v ); } } } public static function translate( $wf_id, $step_idx, $field, $value, $lang = '' ) { $value = (string) $value; if ( '' === $value ) { return $value; } return (string) apply_filters( 'wpml_translate_single_string', $value, self::DOMAIN, self::string_name( $wf_id, $step_idx, $field ), ( '' !== (string) $lang ? (string) $lang : null ) ); } public static function recipient_language_code( $user_id, $email = '', $ctx = array() ) { $code = (string) apply_filters( 'aieo_wpml_recipient_language', '', (int) $user_id, (string) $email, (array) $ctx ); if ( '' !== $code ) { return $code; } $locale = class_exists( 'AIEO_I18n' ) ? AIEO_I18n::recipient_locale( $user_id, $email, $ctx ) : get_locale(); $langs = apply_filters( 'wpml_active_languages', null ); if ( is_array( $langs ) ) { foreach ( $langs as $c => $l ) { if ( isset( $l['default_locale'] ) && $l['default_locale'] === $locale ) { return (string) $c; } } } return strtolower( substr( (string) $locale, 0, 2 ) ); } }