language_folder) ); } public function add_cpt_to_polylang($post_types, $is_settings) { if ( $is_settings ) { // hides 'my_cpt' from the list of custom post types in Polylang settings unset( $post_types['wapf_product'] ); } else { // enables language and translation management for 'my_cpt' $post_types['wapf_product'] = 'wapf_product'; } return $post_types; } } }