WPML
Stato
Risolto
Segnalato per
WPForms Multilingual 0.3.6
Risolto in
WPForms Multilingual 0.4.0
Plugin/tema correlato
WPForms
Tag dell’argomento
Compatibility

Panoramica del problema

Se utilizzi WPForms e il suo componente aggiuntivo WPForms Form Pages, potresti riscontrare un errore 404 quando accedi alle pagine dei moduli nelle lingue secondarie con una struttura dei permalink personalizzata (ad es., /artikel/%postname%/).

Soluzione alternativa

Assicurati di avere un backup completo del sito prima di procedere.


  • Apri il file …/wp-content/plugins/wpforms-form-pages/src/Frontend.php.

  • Cerca la riga 78.

  • Sostituisci:
    			$request = ! empty( $request ) ? sanitize_key( wp_parse_url( $request, PHP_URL_PATH ) ) : '';

  • Con:
    			if ( ! empty( $request ) ) {
    				// Parse the URL to get the path component
    				$path = wp_parse_url( $request, PHP_URL_PATH );
    		
    				// Use a regular expression to remove the language segment (e.g., "/en/") from the path
    				// This pattern assumes the language code is always two characters and follows the first "/"
    				$path = preg_replace( '#^/([a-zA-Z]{2})/#', '/', $path );
    		
    				// Sanitize the resulting path
    				$request = sanitize_key( $path );
    			} else {
    				$request = '';
    			}

Tutti i problemi noti →