1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
if ( !class_exists('Wcap_Localization' ) ) {
class Wcap_Localization{
public static function wcap_register_template_string_for_wpml() {
if ( function_exists('icl_register_string') ) {
global $wpdb;
$context = 'WCAP';
$result = $wpdb->get_results("SELECT * FROM ".WCAP_EMAIL_TEMPLATE_TABLE."");
foreach ( $result as $each_template ) {
$name_msg = 'wcap_template_' . $each_template->id . '_message';
$value_msg = $each_template->body;
icl_register_string($context, $name_msg, $value_msg);
$name_sub = 'wcap_template_' . $each_template->id . '_subject';
$value_sub = $each_template->subject;
icl_register_string($context, $name_sub, $value_sub);
$template_name = 'wcap_template_' . $each_template->id . '_template_name';
$getvalue_template_name = $each_template->template_name;
icl_register_string($context, $template_name, $getvalue_template_name);
$wc_email_header = 'wcap_template_' . $each_template->id . '_wc_email_header';
$getvalue_wc_email_header = $each_template->wc_email_header;
icl_register_string($context, $wc_email_header, $getvalue_wc_email_header);
}
}
}
}
}