Open luileito opened 7 years ago
Hello, I think most users won't need to change this and adding an option for this make things look more complex... What about solving this issue by a simple hook, like this:
add_action('sublanguage_admin_init', function($sublanguage) {
$sublanguage->language_query_var = 'lng'; // or whatever
});
... And by adding this hook in the admin.php file in init():
do_action('sublanguage_admin_init', $this);
Anyway, I think I hard-coded the language query vars in some places, so even if we make changes it won't work correctly, I need to check the code...
Hey, thanks for looking into this. I didn't know of the hook-based approach, maybe it's worth trying though with this PR the plugin is now behaving exactly as I wanted to.
This PR makes the
language_query_var
property name configurable. This way e.g. if my blog is already usinglng=fr
to translate contents, now I can indicate Sublanguage to use thelng
as well (instead of the defaultlanguage
name).See https://wordpress.org/support/topic/customize-query-var-name/