WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
[resolved] Polylang and custom post types (5 posts)

  1. RavanH
    Member
    Posted 1 year ago #

    Hi Chouby & others,

    Could anyone tell me how to approach this issue? Can I use Polylang in conjunction with custom post types that are either pre-existant / defined in the theme or defined via any of the custom post type plugins. I noticed that WPML and the Types plugin are compatible (same author) so I am hoping there is a similar 'easy' solution or combination to be found for Polylang...

    It may be hard to say something about this without a concrete case but a general hint about which route to take here would already be very helpful :)

    Thanks!

    http://wordpress.org/extend/plugins/polylang/

  2. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    Hello!

    You just have to register your post type as usual for example in a function hooked to the 'init' action. If you register it with 'show_ui' set to true, then it is automatically created with multilingual support.

    Otherwise, you can use the 'pll_get_post_types' filter to add multilingual support to a post type with 'show_ui' set to false (or to remove multilingual support to a post type with 'show_ui' set to true).

    I don't know the plugin 'Types'. How 'easy' is the integration of Types with WPML?

  3. RavanH
    Member
    Posted 1 year ago #

    If you register it with 'show_ui' set to true, then it is automatically created with multilingual support.

    Fantastic!

    use the 'pll_get_post_types' filter

    Also at init or is a later point also possible?

    I don't know the plugin 'Types'. How 'easy' is the integration of Types with WPML?

    No idea, just read that it is compatible (which is no surprise since both are by the same dev)...

  4. Chouby
    Member
    Plugin Author

    Posted 1 year ago #

    The 'pll_get_post_types' filter is called in a function hooked to 'wp_loaded', so I expect that it is used in a function hooked to 'init'.

  5. RavanH
    Member
    Posted 1 year ago #

    Anywhere before wp_loaded gets fired then... Thanks for the tips and help :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags