Skip to content

Instantly share code, notes, and snippets.

View hyperframed's full-sized avatar

Hyperframed hyperframed

View GitHub Profile
@hyperframed
hyperframed / minimum-upload.php
Created July 4, 2021 15:03
Wordpress Minimum Image Dimension for Uploads
add_filter('wp_handle_upload_prefilter','tc_handle_upload_prefilter');
function tc_handle_upload_prefilter($file)
{
$img=getimagesize($file['tmp_name']);
$minimum = array('width' => '400', 'height' => '400');
$width= $img[0];
$height =$img[1];
if ($width < $minimum['width'] )