Background of the issue:
I need help translating custom code on my site versteckter Link. I am trying to find strings and admin text for translation but can't locate them.
Symptoms:
I can't find the strings and admin text for translation.
Questions:
How can I find and translate custom code strings using WPML? I used this code.
// Add required fields for terms and newsletters
add_filter('tutor_student_registration_required_fields', 'required_terms_newsletters_callback');
if ( ! function_exists('required_terms_newsletters_callback')){
function required_terms_newsletters_callback($atts){
$atts['agree_terms'] = 'You must agree to the Privacy Policy and Terms of Use.';
$atts['newsletter_consent'] = 'You must consent to receive newsletters.';
return $atts;
}
}
// Save checkbox values after registration
add_action('user_register', 'save_checkbox_after_registration');
add_action('profile_update', 'save_checkbox_after_registration');
if ( ! function_exists('save_checkbox_after_registration')) {
function save_checkbox_after_registration($user_id){
if (isset($_POST['agree_terms'])) {
update_user_meta($user_id, '_agree_terms', 'yes');
}
if (isset($_POST['newsletter_consent'])) {
update_user_meta($user_id, '_newsletter_consent', 'yes');
}
}
}