mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-17 05:23:22 +09:00
Fix image validation
This commit is contained in:
@@ -177,29 +177,6 @@ class Display_Featured_Image_Genesis_Settings_Validate extends Display_Featured_
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if file type is image. updated to use WP function.
|
||||
* @return bool
|
||||
* @since 1.2.2
|
||||
* @since 2.5.0
|
||||
*/
|
||||
protected function is_valid_img_ext( $file ) {
|
||||
$valid = wp_check_filetype( $file );
|
||||
|
||||
return (bool) in_array( $valid['ext'], $this->allowed_file_types(), true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the array of allowed image/file types.
|
||||
* @return array
|
||||
* @since 2.5.0
|
||||
*/
|
||||
protected function allowed_file_types() {
|
||||
$allowed = apply_filters( 'displayfeaturedimage_valid_img_types', array( 'jpg', 'jpeg', 'png', 'gif' ) );
|
||||
|
||||
return is_array( $allowed ) ? $allowed : explode( ',', $allowed );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a 1 or 0, for all truthy / falsy values.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user