add_filter('cred_form_ajax_upload_validate','my_validation_artist',10,2);
function my_validation_artist($error_fields, $form_data)
{
//field data are field values and errors
list($fields,$errors)=$error_fields;
//validate if specific form
if ($form_data['id']==98)
{
//check if featured image exists o
if (isset($fields['_featured_image']))
{
list($width, $height, $type, $attr) = getimagesize($fields['_featured_image']['field_data']['tmp_name']);
if ($width != 500 && $height != 500) {
//set error message for featured image
$errors['_featured_image'] = 'Image size must be 500 * 500, your image dimensions are '.$width.' * '.$height;
}
}
}
//return result
return array($fields,$errors);
}