Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    When a custom post type doesn’t appear in the options, they are 2 possible reasons:
    1. The post type is registered as “not public”. Only public post types are added to the options by default.
    2. The developper has explicitely set the post type as “not translatable”.

    In both cases, you van override the behavior with PHP filters https://polylang.pro/doc/filter-reference/#pll_get_post_types or a wmpl-config.xml file: https://polylang.pro/doc/the-wpml-config-xml-file/

    Hey Chouby,

    I’m the lead dev of the theme in question. The issue we’ve hit is that we use this CPT as global content areas in the theme, similar to widget areas, but so we can use blocks. I’d like to add Polylang support but hit a few walls. The main issue here is that the CPT is queried by slug via get_page_by_path(). Even if I make the CPT translatable via your filter I’m still unable to check and swap the translated version if it’s available. Maybe you can point me in the right direction?

    Plugin Author Chouby

    (@chouby)

    Hello @jivedig,

    I am not sure I correctly catched your issue. But if you are looking to get the translation of your post returned by get_page_by_path(), you can use https://polylang.pro/doc/function-reference/#pll_get_post which, given a post id, returns the post id of the translation in the current language.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom post types translate option not available in my web’ is closed to new replies.