Changeset 3089813
- Timestamp:
- 05/21/2024 04:12:22 AM (22 months ago)
- Location:
- cits-support-svg-webp-media-upload/trunk
- Files:
-
- 8 added
- 2 edited
-
admin (added)
-
admin/cits-admin.css (added)
-
admin/cits-admin.php (added)
-
admin/images (added)
-
admin/images/close.svg (added)
-
admin/images/envelope.svg (added)
-
admin/images/heart.svg (added)
-
admin/images/star.svg (added)
-
init.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cits-support-svg-webp-media-upload/trunk/init.php
r3085990 r3089813 13 13 License: GPL2 14 14 */ 15 15 define('CITS_PLUGIN_URL', plugin_dir_url(__FILE__)); 16 define('CITS_PLUGIN_PATH', plugin_dir_path(__FILE__)); 16 17 require_once __DIR__ . '/vendor/autoload.php'; 17 18 18 19 class CITS_SUPPORT_SVG_WEBP_MEDIA { 19 20 public function __construct() { 21 add_action('admin_enqueue_scripts', array($this, 'cits_enqueue_admin_styles')); 22 20 23 add_filter('upload_mimes', array($this, 'cits_upload_media_mimes')); 21 24 add_filter('file_is_displayable_image', array($this, 'cits_is_displayable_webp'), 10, 2); … … 23 26 add_filter('wp_check_filetype_and_ext', array($this, 'cits_check_types'), 10, 4); 24 27 add_filter('wp_handle_upload_prefilter', array($this, 'cits_sanitize_svg')); 28 29 // Include the admin file 30 include CITS_PLUGIN_PATH . 'admin/cits-admin.php'; 25 31 } 26 32 … … 59 65 $type = $check_filetype['type']; 60 66 $proper_filename = $filename; 61 if ($type && 0 === strpos($type, 'image/') && $ext !== 'svg') {67 if ($type && (0 === strpos($type, 'image/')) && ($ext !== 'svg' && $ext !== 'webp' && $ext !== 'ico')) { 62 68 $ext = $type = false; 63 } 69 } 64 70 $checked = compact('ext', 'type', 'proper_filename'); 65 71 } … … 123 129 return $file; 124 130 } 131 132 function cits_enqueue_admin_styles() { 133 wp_enqueue_style('cits_admin_css', CITS_PLUGIN_URL . 'admin/cits-admin.css'); 134 } 125 135 } 126 136 -
cits-support-svg-webp-media-upload/trunk/readme.txt
r3085996 r3089813 22 22 * ICO Media support 23 23 24 == Video Tutorial == 25 How to Install and Active Plugin 26 https://www.youtube.com/watch?v=ag_ujxvW9Uo 27 24 28 == Installation == 25 29
Note: See TracChangeset
for help on using the changeset viewer.