Hi @devmania,
Is there a way to translate Job categories?
Great question! I tested WPJM with Polylang and it doesn’t look like Polylang supports our custom category. Do you know if we need to do something to allow it to support our category, or does Polylang need to add something to their plugin to support our categories?
Hi, generally speaking, Polylang does support added custom post types and taxonomies like job listings and job types, but for categories, I don’t know why they are not supported, probably they are declared/added in a special way that makes them incompatible with Polylang.
Is there a filter hook related to categories that can be used to translate caetgories within functions.php at specific moments for example when rendering the categroies in the <select> items.
I can create a lookup array to translate them before rendering.
Hi @devmania,
There is a filter in Polylang to do this, here’s how it works:
add_filter( 'pll_get_taxonomies', 'add_tax_to_pll', 10, 2 );
function add_tax_to_pll( $taxonomies, $is_settings ) {
if ( $is_settings ) {
unset( $taxonomies['job_listing_category'] );
} else {
$taxonomies['job_listing_category'] = 'job_listing_category';
}
return $taxonomies;
}
Cheers,
Just a note that I’m going to add this to WP Job Manager as well, it will likely be in the next release! 🙂
Thanks.
It worked in functions.php.
-
This reply was modified 8 months, 3 weeks ago by
devmania.
-
This reply was modified 8 months, 3 weeks ago by
devmania.
Plugin Support
Jay
(@bluejay77)
Thanks for letting us know, @devmania!