Viewing 6 replies - 1 through 6 (of 6 total)
  • As writer of a (future) deep article where multilingual plugins will be compared… we note that:
    polylang doesn’t detect available custom post types (CPT)

    instead of xili-language
    which offers in his settings a list of detected CPT to be checked if you want (or not) that can be attached to a language…

    Plugin Author Chouby

    (@chouby)

    @sitting Bull
    which plugin are you using? Simple Custom Types or Advanced Custom fields ?

    Currently there is no way in the user interface to add or remove language support for custom post types. However, you can change this in a custom plugin. Juste create a new file call my-custom-plugin.php, copy paste the following code:

    <?php
    /*
    Plugin Name: My custom plugin
    */
    add_filter('pll_get_post_types', 'my_pll_get_post_types');
    function my_pll_get_post_types($types) {
    	unset ($types['my-cpt']); // you have to replace my-cpt by the name of your custom post type
    	return $types;
    }

    Then upload the file in wp-content/plugins and activate the plugin

    Thread Starter Sitting Bull

    (@mojaregistrackagmailcom)

    Thanks a lot!! It works. For creating custom types I use Simple Custom Types.

    I use Advanced Custom fields for creating meta boxes. And here is still one problem. I created meta boxes for page templates. Advanced Custom fields have multilingual support too but when I created meta boxes in one language I can see it in diffent language too when I set template for page. This is ok because it’s exactly what I need. I want to see my meta boxes in all languages (maybe better will be to have possibility to set it as “All languages”). The problem is that in lang switcher in top admin bar I have to select All languages or language in which my meta boxes where created. If I select different language my meta boxes just disapear but it still works.

    So is there possibility to set Advanced Custom fields nonmultilingual and have them for pages and posts in all languages? Or if not is it possible to see them in pages and posts even the lang switcher is selected to different language as they were created for?

    Thanks a lot again!

    Plugin Author Chouby

    (@chouby)

    Sorry with all these ‘custom’, I mixed ‘custom post types’ and ‘custom fields’

    Well here again, the automatic language support to custom post types added by Polylang results in unexpected results… Unfortunately what is good for some plugins is wrong for others.

    So I suggest that you add a line in the function described above:

    unset($types['acf']);

    For information, it is in my roadmap for 1.0 to improve the user interface to avoid this kind of code manipulation.

    Thread Starter Sitting Bull

    (@mojaregistrackagmailcom)

    Can I use it for media files too? I tried this:

    unset ($types[‘attachment’]);

    but it doesn’t work.
    Thanks a lot!

    Plugin Author Chouby

    (@chouby)

    As described in the doc, add:
    define('PLL_MEDIA_SUPPORT', false);
    in wp-config.php

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Polylang] Turn off multilingual support for custom types’ is closed to new replies.