Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    You have probably to create a filter function that can handle this situation. Something like this:

    /**
     * @param string $postlink
     * @param string $language
     * @return string
     */
    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'fr_FR' == $language ) {
            $url = str_replace( '/car/', '/voiture/', $url );
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );
    Thread Starter meneldil

    (@meneldil)

    It works perfectly.
    Thank you so much! 🙂

    Thread Starter meneldil

    (@meneldil)

    I have a supplementary question.

    In the plugin settings, I have a “Rewrites Settings” section with a “Car Slug” field.

    Is it possible to make this input modifiable? (“readonly” currently)
    So the plugin could handle the dynamic translation of custom permalinks (like Polylang or WPML for example).

    Thanks.

    Plugin Author Dennis Ploetner

    (@realloc)

    These fields are meant for this kind of problem. Do the values differ when you switch between the languages in the dashboard?

    Thread Starter meneldil

    (@meneldil)

    No, they are identical.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Custom post type + Dynamic slug = 404’ is closed to new replies.