WPML

문제 개요

The Events Calendar 플러그인과 해당 플러그인의 Integrate events in main blog loop 기능을 사용하는 경우, URL(example.com?foo=bar)에 매개변수가 추가될 때 루트 페이지가 빈 화면으로 표시되는 문제가 발생합니다. 이 문제는 특히 WPML의 기본 언어에 디렉토리 사용 설정이 함께 활성화되어 있을 때 발생합니다.

임시 해결 방법

진행하기 전에 사이트의 전체 사이트 백업을 완료했는지 확인하세요.

  • …/wp-content/plugins/the-events-calendar/src/Tribe/Query.php 파일을 여세요.
  • 577번째 줄을 찾으세요.
  • 다음을:
    protected static function add_post_type_to_query( WP_Query $query, string ...$post_types ): void {
    
    	$query_post_types = self::get_query_post_types( $query );
    
    	$updated_post_types = array_unique( array_merge( $post_types, $query_post_types ) );
    
    	$query->set( 'post_type', $updated_post_types );
    	$query->query['post_type'] = $updated_post_types;
    }
  • 다음으로 바꾸세요:
    protected static function add_post_type_to_query( WP_Query $query, string ...$post_types ): void {
    
    	$query_post_types = self::get_query_post_types( $query );
    
    	// WPML Workaround for compsupp-7426
    	if ( class_exists('Sitepress') ) {
    		$is_root_enabled = apply_filters( 'wpml_sub_setting', false, 'urls', 'directory_for_default_language' );
    
    		if ( $is_root_enabled && is_home() ) {
    			return;
    		}
    	}
    
    	$updated_post_types = array_unique( array_merge( $post_types, $query_post_types ) );
    
    	$query->set( 'post_type', $updated_post_types );
    	$query->query['post_type'] = $updated_post_types;
    }

모든 알려진 문제