Hi Jonas,
The problem with this approach is that I would have to reload and save the whole default template, and that it would overwrite the changes made by the user. Unfortunatley, I can’t do that because it won’t match most use cases.
But you can implement the hook on your functions.php file. Try the code below (untested).
add_action('update_option_WPLANG', function( $old_value, $value ) {
if( $old_value === $value )
return false;
global $wp_better_emails;
delete_option('wpbe_options');
$wp_better_emails->set_options();
});
Note that all options are deleted on each language change.
Hi
Thanks for your answer & time for support. Im gonna try to hook in as suggested. The template should maybe be saved in a separate option, and frwite into a theme template file in user folder theme. A simple checkbox on the setting to allow re-read the user template on language change.
Ill will do some invetigation on your default opt array…
THanks, marking this as solved.
The template should maybe be saved in a separate option, and frwite into a theme template file in user folder theme. A simple checkbox on the setting to allow re-read the user template on language change.
Writing files in the user folder is a bad practice for many reasons.
The main problem is that there is only one template and once activated and saved, I have to consider that I can’t modify it anymore (because the user could have made changes that It would not be correct to overwrite).
To be honest, I’d like to update the plugin to add some new features (multiple templates, responsive templates, smtp, etc.). It’s still doing the job but could be improved. But I’m unfortunately lacking spare time to achieve this. I’ll try to release a new version by spring time.