כרגע בשביל שהאתר יראה נורמלי עשיתי מין פלסטר כזה:
שמכריח את הheader להציג את התמונות של הלוגו וההמבורגר.
אני חושש שיש עוד מקומות באתר שזה קורה....
function ensure_main_language_attachment_src($image, $attachment_id, $size, $icon) {
if (function_exists('icl_get_default_language') && is_array($image)) {
$default_language = icl_get_default_language();
$current_language = ICL_LANGUAGE_CODE;
// If we're not in the default language, get the main language version
if ($current_language !== $default_language) {
$main_id = icl_object_id($attachment_id, 'attachment', false, $default_language);
$ids_to_switch = array(6254,1314);
if ($main_id && $main_id !== $attachment_id && in_array($main_id, $ids_to_switch)) {
$new_image = wp_get_attachment_image_src($main_id, $size, $icon);
//log_to_console(array('old_image' => $image, 'new_image' => $new_image, 'attachment_id' => $attachment_id, 'main_id' => $main_id, 'size' => $size, 'icon' => $icon));
return $new_image;
}
}
}
return $image;
}