- Trạng thái
- Đang mở
- Plugin/giao diện liên quan
- The Events Calendar
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Nếu bạn đang sử dụng plugin The Events Calendar và tính năng Integrate events in main blog loop của plugin này, bạn sẽ thấy trang gốc hiển thị trắng khi có bất kỳ tham số nào được thêm vào URL (example.com?foo=bar). Vấn đề này xảy ra cụ thể khi cài đặt Sử dụng thư mục cho ngôn ngữ mặc định của WPML cũng được bật.
Giải pháp tạm thời
Vui lòng đảm bảo có bản sao lưu toàn bộ trang web trước khi tiếp tục.
- Mở tệp …/wp-content/plugins/the-events-calendar/src/Tribe/Query.php.
- Tìm dòng 577.
- Thay thế:
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; } - Bằng:
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; }