- 상태
- 해결됨
- 해결된 버전
- WPML 4.7.6
- 관련 플러그인/테마
- Elementor
- 주제 태그
- Compatibility
문제 개요
Elementor Pro 위젯 고급 설정에서 사용자가 로그인한 경우에만 위젯을 표시하는 등의 디스플레이 조건을 추가할 수 있습니다.
최근 Elementor가 이 데이터를 저장하는 방식이 변경되어 다음 오류가 발생할 수 있습니다:
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in .../wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php:138
임시 해결 방법
Elementor 데이터 저장소의 이러한 변경 사항을 처리하도록 코드를 업데이트할 예정입니다. 그동안 다음 플러그인 파일을 편집할 수 있습니다: wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php
convertConditionIds 함수(현재 버전의 134번째 줄부터 시작)를 찾아 아래 코드로 교체하세요:
private function convertConditionIds( array $conditionGroups ) {
// ensure $conditionGroups is an array of arrays and not just an associative array
$result = array_keys($conditionGroups)[0] !== 0 ? array($conditionGroups) : $conditionGroups;
foreach ( $result as $key => $conditionGroup ) {
$configForCondition = $this->getConfigForCondition( $conditionGroup['condition'] );
if ( $configForCondition && isset( $conditionGroup[ $configForCondition['field'] ] ) ) {
$result[ $key ] = $this->convertIdsForCondition( $conditionGroup, $configForCondition );
}
}
return $result;
}