Support » Plugin: Multisite Language Switcher » Custom post type + Dynamic slug = 404

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 );

    It works perfectly.
    Thank you so much! 🙂

    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?

    meneldil

    (@meneldil)

    No, they are identical.

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