Support » Plugin: Post Type Archive Pages » compatibility Polylang

  • Hello, it is compatible with Polylang or WPML plugin? Thank you.

    With function like below you can get ID of translated page id

    function get_page_language_by_id( $id, $return_original_if_missing = true ) {
        if ( function_exists( 'pll_get_post' ) ) {
            return ( $ppl_id = pll_get_post( $id ) ) ? $ppl_id : ( ( $return_original_if_missing ) ? $id : '' );
        } else if ( function_exists( 'icl_object_id' ) ) {
            return icl_object_id( $id, get_post_type( $id ), $return_original_if_missing );
        }
        return $id;
    }
    • This topic was modified 7 months, 3 weeks ago by Hrohh.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Hrohh

    (@hrohh)

    Also please
    <p><?php _e( ‘Select the page to display the archive for each of your post types.’, ‘post-type-archive-pages’ ); ?></p>

    zadine

    (@zadine)

    This is just the feature I was looking for! Can I add that code to plugin myself somehow?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.