• Resolved ionutm

    (@ionutm)


    hi

    i have some CPT’s and a Custom Taxonomy that are not public but i want to translate them.

    they don’t appear in wp-admin/admin.php?page=mlang_settings ‘Custom post types and Taxonomies’

    i have added a xpml-config.xml and no luck

    <wpml-config>
    	<custom-types>
    		<custom-type translate="1">team</custom-type>
    		<custom-type translate="1">testimonial</custom-type>
    	</custom-types>
    	<taxonomies>
    		<taxonomy translate="1">testimonial-types</taxonomy>
    	</taxonomies>
    </wpml-config>
    

    i have also tried with pll_get_post_types and pll_get_taxonomies and also failed.

    <?php
    add_filter('pll_get_post_types', 'add_cpt_to_pll', 10, 2);
    function add_cpt_to_pll($post_types, $is_settings)
    {
    	if ( $is_settings )
    	{
    		$post_types['testimonial'] = 'Testimonial';
    		$post_types['team'] = 'Team';
    	}
    
    	return $post_types;
    }
    
    add_filter('pll_get_taxonomies', 'add_tax_to_pll', 10, 2);
    function add_tax_to_pll($taxonomies, $is_settings)
    {
    	if ( $is_settings )
    	{
    		$taxonomies['testimonial-types'] = 'Testimonial categories';
    	}
    
    	return $taxonomies;
    }
    

    any suggestions ?

    • This topic was modified 4 years, 3 months ago by ionutm.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    When you use the wpml-config.xml file, the post types and taxonomies defined in the file are not visible in the settings (we suppose that developpers know what they do). However, you should see that the post types and taxonomies became translatable for example by looking at the post list table and term list table which should include the language columns.

    Thread Starter ionutm

    (@ionutm)

    ok thanks i got it in reverse 🙂

    Thread Starter ionutm

    (@ionutm)

    forgot to close

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘public queryable and pll_get_post_types and pll_get_taxonomies question’ is closed to new replies.