$field['value'] ); } if (is_string($field['value'])) { $field['value'] = @json_decode($field['value'], TRUE); } $value = $field['value']; $o = array(); $attachment = acf_get_attachment($value['id']); $fallback_attachment = acf_get_attachment(@$value['fallback_id']); if ($attachment) { // has value $div['class'] .= ' has-value'; $div['class'] .= ' is-' . $attachment['type']; // update $o['title'] = $attachment['title']; $o['title_text'] = @$value['title']; $o['title_alt'] = @$value['alt']; $o['url'] = $attachment['url']; $o['filename'] = $attachment['filename']; $o['fallback_url'] = $fallback_attachment['url']; $o['fallback_filename'] = $fallback_attachment['filename']; if ($attachment['filesize']) { $o['filesize'] = size_format($attachment['filesize']); } } } if (!function_exists('check_active')) { function check_active($current_alignment, $v_val, $h_val) { if ($v_val && $v_val == $current_alignment) { echo 'active'; } else if ($h_val && $h_val == $current_alignment) { echo 'active'; } } } ?>