Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function get_translated_image_by_url( $img_src, $source_language, $target_language ){
- $attachment_id = $this->get_attachment_image_from_guid($img_src, $source_language);
- if (!$attachment_id) {
- $attachment_id = $this->get_attachment_image_from_meta($img_src, $source_language);
- }
- if ($attachment_id){
- $size = $this->get_image_size_from_url($img_src, $attachment_id);
- return $this->get_translated_image($attachment_id, $target_language, $size);
- } else {
- return $img_src;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement