- 상태
- 개발자가 해결함
- 관련 플러그인/테마
- Houzez
- 주제 태그
- Compatibility
문제 개요
Houzez 테마를 사용할 때, 미디어 섹션을 통해 추가된 부동산 미디어 이미지가 번역된 부동산 페이지에서 번역된 ALT 텍스트를 표시하지 않습니다.
임시 해결 방법
진행하기 전에 전체 사이트 백업을 완료했는지 확인하세요.
- 테마의 functions.php 파일을 여세요.
- 다음 스니펫을 추가하세요:
add_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10, 4); function wpml_compsupp7300_filter_fave_property_images($null, $object_id, $meta_key, $single) { // Target the specific meta key if ($meta_key !== 'fave_property_images') { return $null; } // Prevent recursion by temporarily removing the filter remove_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10); // Fetch the original meta value $images = get_post_meta($object_id, $meta_key, $single); // Re-add the filter add_filter('get_post_metadata', 'wpml_compsupp7300_filter_fave_property_images', 10, 4); // Check if we actually got an array if (is_array($images)) { foreach ($images as &$image_id) { // Apply the WPML filter to each item (image ID) $image_id = apply_filters('wpml_object_id', $image_id, 'attachment', true); } } return $images; }