- Trạng thái
- Đã được giải quyết bởi nhà phát triển
- Đã giải quyết trong
- Themify Ultra 8.0.1
- Plugin/giao diện liên quan
- Themify Ultra
- Thẻ chủ đề
- Compatibility
Tổng quan về lỗi
Khi dịch một trang bằng WPML với mô-đun Feature Content trong giao diện Themify Ultra, văn bản ALT của hình ảnh không được dịch trên giao diện người dùng.
Giải pháp tạm thời
Vui lòng đảm bảo bạn có bản sao lưu toàn bộ trang web trước khi tiếp tục.
- Mở tệp …/wp-content/themes/themify-ultra/themify/themify-builder/classes/class-themify-builder-model.php.
- Tìm dòng 357.
- Thay thế:
public static function get_alt_by_url(string $image_url):string { $attachment_id = themify_get_attachment_id_from_url($image_url); if ($attachment_id && ($alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true))) { return $alt; } return ''; } - Bằng:
public static function get_alt_by_url(string $image_url):string { $attachment_id = themify_get_attachment_id_from_url($image_url); // WPML Workaround for wpmlsupp-12600 if ( class_exists('Sitepress') ) { $current_lang = apply_filters( 'wpml_current_language', NULL ); $attachment_id = apply_filters( 'wpml_object_id', $attachment_id, 'post', TRUE, $current_lang ); } if ($attachment_id && ($alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true))) { return $alt; } return ''; }