includes/types/CMB2_Type_File.php 1 location
|
@@ 71-76 (lines=6) @@
|
| 68 |
|
|
| 69 |
|
if ( $this->is_valid_img_ext( $meta_value ) ) { |
| 70 |
|
|
| 71 |
|
if ( $_id_value ) { |
| 72 |
|
$image = wp_get_attachment_image( $_id_value, $img_size, null, array( 'class' => 'cmb-file-field-image' ) ); |
| 73 |
|
} else { |
| 74 |
|
$size = is_array( $img_size ) ? $img_size[0] : 350; |
| 75 |
|
$image = '<img style="max-width: ' . absint( $size ) . 'px; width: 100%; height: auto;" src="' . $meta_value . '" alt="" />'; |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
$output .= $this->img_status_output( array( |
| 79 |
|
'image' => $image, |
includes/CMB2_Field_Display.php 1 location
|
@@ 397-402 (lines=6) @@
|
| 394 |
|
if ( $field_type->is_valid_img_ext( $url_value ) ) { |
| 395 |
|
$img_size = $this->field->args( 'preview_size' ); |
| 396 |
|
|
| 397 |
|
if ( $id ) { |
| 398 |
|
$image = wp_get_attachment_image( $id, $img_size, null, array( 'class' => 'cmb-image-display' ) ); |
| 399 |
|
} else { |
| 400 |
|
$size = is_array( $img_size ) ? $img_size[0] : 200; |
| 401 |
|
$image = '<img class="cmb-image-display" style="max-width: ' . absint( $size ) . 'px; width: 100%; height: auto;" src="' . $url_value . '" alt="" />'; |
| 402 |
|
} |
| 403 |
|
|
| 404 |
|
echo $image; |
| 405 |
|
|