- This topic has 0 replies, 1 voice, and was last updated 6 years, 4 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore F.A.Q/Instructions › How to Load the WP eStore's Language File from Another Folder
Tagged: customization, Language, WP eStore
If you are customizing the text/messages displayed by the plugin then this tweak maybe helpful.
You can keep your customized copy of the language file in a different folder (outside the plugins folder). Then use the following code to load it (uses the eStore_language_loading_override filter).
That way the changes you make to the language file don’t get overridden if the plugin is updated.
You would add the following code to your theme’s functions.php file or a custom plugin.
add_filter('eStore_language_loading_override', 'load_my_custom_language');
function load_my_custom_language()
{
$language_file = "/path/to/your/custom/language/file/lang.php";
include_once($language_file);
return "custom-file-loaded";
}
This ensures that the plugin will always load your custom language file from your custom folder (so the one inside the plugin folder doesn’t matter).