@@ 3317-3331 (lines=15) @@ | ||
3314 | $min_width = (int) acf_maybe_get($field, 'min_width', 0); |
|
3315 | $max_width = (int) acf_maybe_get($field, 'max_width', 0); |
|
3316 | ||
3317 | if( $file['width'] ) { |
|
3318 | ||
3319 | if( $min_width && $file['width'] < $min_width ) { |
|
3320 | ||
3321 | // min width |
|
3322 | $errors['min_width'] = sprintf(__('Image width must be at least %dpx.', 'acf'), $min_width ); |
|
3323 | ||
3324 | } elseif( $max_width && $file['width'] > $max_width ) { |
|
3325 | ||
3326 | // min width |
|
3327 | $errors['max_width'] = sprintf(__('Image width must not exceed %dpx.', 'acf'), $max_width ); |
|
3328 | ||
3329 | } |
|
3330 | ||
3331 | } |
|
3332 | ||
3333 | ||
3334 | // height |
|
@@ 3338-3352 (lines=15) @@ | ||
3335 | $min_height = (int) acf_maybe_get($field, 'min_height', 0); |
|
3336 | $max_height = (int) acf_maybe_get($field, 'max_height', 0); |
|
3337 | ||
3338 | if( $file['height'] ) { |
|
3339 | ||
3340 | if( $min_height && $file['height'] < $min_height ) { |
|
3341 | ||
3342 | // min height |
|
3343 | $errors['min_height'] = sprintf(__('Image height must be at least %dpx.', 'acf'), $min_height ); |
|
3344 | ||
3345 | } elseif( $max_height && $file['height'] > $max_height ) { |
|
3346 | ||
3347 | // min height |
|
3348 | $errors['max_height'] = sprintf(__('Image height must not exceed %dpx.', 'acf'), $max_height ); |
|
3349 | ||
3350 | } |
|
3351 | ||
3352 | } |
|
3353 | ||
3354 | } |
|
3355 |