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

    (@realloc)

    Yes, this is an issue with localized slugs for custom post types. There is a workaround for this problem:

    http://msls.co/developer-docs/hook-reference.html#msls-options-get-permalink

    Thread Starter gaekko

    (@gaekko)

    Hallo Dennis,

    danke für Deine Hilfe
    d.h. in diese Datei
    /wp-content/plugins/multisite-language-switcher/MultisiteLanguageSwitcher.php

    füge ich dann folgendes ein:

    function my_msls_options_get_permalink( $url, $language ) {
    if ( ‘de_DE’ == $language ) {
    $url = str_replace( ‘/Picture-hangers/’, ‘/Bildaufhaenger/’, $url );
    }
    return $url;
    }
    add_filter( ‘msls_options_get_permalink’, ‘my_msls_options_get_permalink’, 10, 2 );

    ? und was ist mit der Französischen Version?

    Danke Dir!

    oder so?

    /**
     * @param string $postlink
     * @param string $language
     * @return string
     */
    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'de_DE' == $language ) {
            $url = str_replace( '/bildaufhaenger/', '/picture-hangers/', $url );
        }
        if ( 'de_DE' == $language ) {
            $url = str_replace( '/bildaufhaenger/', '/accroches-tableaux/', $url );
        }
        if ( 'fr_FR' == $language ) {
            $url = str_replace( '/accroches-tableaux/', '/bildaufhaenger/', $url );
        }
        if ( 'fr_FR' == $language ) {
            $url = str_replace( '/accroches-tableaux/', '/picture-hangers/', $url );
        }
        if ( 'en_EN' == $language ) {
            $url = str_replace( '/picture-hangers/', '/bildaufhaenger/', $url );
        }
        if ( 'en_EN' == $language ) {
            $url = str_replace( '/picture-hangers/', '/accroches-tableaux/', $url );
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );
    • This reply was modified 4 years, 10 months ago by gaekko.
    Plugin Author Dennis Ploetner

    (@realloc)

    Der PHP-Code sollte in der functions.php des (Child)Themes untergebracht werden. Man kann das in etwa so machen:

    function my_msls_options_get_permalink( $url, $language ) {
    	switch ( $language ) {
    		case 'de_DE':
    			$url = str_replace( '/bildaufhaenger/', '/picture-hangers/', $url );
    			$url = str_replace( '/bildaufhaenger/', '/accroches-tableaux/', $url );
    		case 'fr_FR':
    			$url = str_replace( '/accroches-tableaux/', '/bildaufhaenger/', $url );
    			$url = str_replace( '/accroches-tableaux/', '/picture-hangers/', $url );
    		case 'en_EN':
    			$url = str_replace( '/picture-hangers/', '/bildaufhaenger/', $url );
    			$url = str_replace( '/picture-hangers/', '/accroches-tableaux/', $url );
    	}
    
    	return $url;
    }
    
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );
    Thread Starter gaekko

    (@gaekko)

    Danke Dennis. Das habe ich gemacht, jedoch ist die Verlinkung immer noch optisch falsch.
    “Bildaufhaenger” ist bei Permalinks unten eingetragen, siehe hier:
    https://www.directupload.net/file/d/6259/fjoc7xhz_png.htm

    und als Kategorie haben wir “Produkte”

    Plugin Author Dennis Ploetner

    (@realloc)

    Ich habe den gelieferten Code bereinigt, nichts weiteres! Bitte für einen Ansatz entscheiden: Code oder Konfiguration im Dashboard. Wenn Dashboard, bitte jede Website konfigurieren. 😉

    Thread Starter gaekko

    (@gaekko)

    also wir haben es jetzt in die Functions.php eingefügt, jedoch sind die URL immer noch unkorrigiert.

    Plugin Author Dennis Ploetner

    (@realloc)

    Bitte die Permalinks auffrischen und noch einmal überprüfen!

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

The topic ‘Plugin does not link to the correct page’ is closed to new replies.