Apparently, you need to add a filter:
add_filter(‘pll_get_post_types’, ‘add_my_cpt_to_polylang’);
function add_my_cpt_to_polylang($post_types) {
$post_types[] = ‘certification’; // Replace with your CPT slug
$post_types[] = ‘ingredient’; // Replace with your CPT slug
$post_types[] = ‘testimonial’; // Replace with your CPT slug
return $post_types;
Plugin Author
Chouby
(@chouby)
Hello,
This is indeed a way. You can also use a wpml-config.xml file https://polylang.pro/documentation/support/developers/the-wpml-config-xml-file/.
NB: By default, the CPT are displayed in the Polylang settings only if they are registered with public => true. Otherwise they are intentionally not displayed and you must declare them translatable programmatically as you did.