0 entries in
lue when validation error. * @return string An image URL value or default value. */ function tripp_customize_validate_image( $value, $default = '' ) { // Array of valid image file types. // The array includes image mime types. // that are included in wp_get_mime_types(). $mimes = array( 'jpg|jpeg' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', ); // Return an array with file extension. // and mime_type. $file = wp_check_filetype( $value, $mimes ); // If $input has a valid mime_type, // return it; otherwise, return // the default. return $file['ext'] ? $value : $default; }