- 상태
- 해결됨
- 보고된 제품
- WPForms Multilingual 0.3.6
- 해결된 버전
- WPForms Multilingual 0.4.0
- 관련 플러그인/테마
- WPForms
- 주제 태그
- Compatibility
문제 개요
WPForms 및 WPForms Form Pages 애드온을 사용하는 경우, 사용자 정의 고유주소 구조(예: /artikel/%postname%/)를 사용하는 보조 언어의 양식 페이지에 액세스할 때 404 오류가 발생할 수 있습니다.
임시 해결 방법
진행하기 전에 사이트의 전체 사이트 백업이 있는지 확인하세요.
- …/wp-content/plugins/wpforms-form-pages/src/Frontend.php 파일을 여세요.
- 78번 줄을 찾으세요.
- 다음 코드를:
$request = ! empty( $request ) ? sanitize_key( wp_parse_url( $request, PHP_URL_PATH ) ) : '';
- 다음 코드로 바꾸세요:
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 = ''; }