/
home
/
henzagold
/
blog
/
wp-content
/
themes
/
gillion
/
File Upload :
llllll
Current File: /home/henzagold/blog/wp-content/themes/gillion/functions.php
<?php if ( ! defined( 'ABSPATH' ) ) { die( 'Direct access forbidden.' ); } /** * Load framework */ require_once ( trailingslashit( get_template_directory() ) . '/inc/init.php' ); /** * Setup Yellow Pencil Pro */ define('YP_THEME_MODE', "true"); function webp_upload_mimes( $existing_mimes ) { // add webp to the list of mime types $existing_mimes['webp'] = 'image/webp'; // return the array back to the function with our added mime type return $existing_mimes; } add_filter( 'mime_types', 'webp_upload_mimes' ); //** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2); add_filter('upload_mimes', 'my_upload_mimes'); function my_upload_mimes($mimes = array()) { $mimes['svg'] = 'image/svg+xml'; return $mimes; }
Copyright ©2k19 -
Hexid
|
Tex7ure