当前位置:网站首页>WordPress media library supports uploading and previewing SVG icons
WordPress media library supports uploading and previewing SVG icons
2022-06-21 08:14:00 【Ashi】
WordPress By default, it supports a variety of image formats, including .jpg,.jpeg,.png, and .gif, For security reasons, scalable vector graphics cannot be uploaded (SVG).SVG Is one of the most flexible image types , It's based on XML Vector image of , Websites can usually use it to display logos and icons on their websites . SVG The main reason for growing popularity is the scalable image format , Usually the file size is small ( Sometimes quite large ), And will not be pixelated on the retina screen , Don't like jpg,png Such as the image format that is easy to blur .
Let the media library support SVG Upload
/* Add media library SVG Icon support */function salong_mime_types($mimes) { $mimes['svg'] = 'image/svg+xml'; return $mimes;}add_filter('upload_mimes', 'salong_mime_types');Show in media library SVG Icon
/* Show in media library SVG Icon */function salong_admin_svg_css() { echo "<style>table.media .column-title .media-icon img[src*='.svg']{ width: 100%; height: auto; }</style>";}add_action( 'admin_head', 'salong_admin_svg_css' );Both of the above code are added to the topic functions.php Function file .
边栏推荐
- Vision_ Transformer code exercise
- Using the method of combining shapes in illustrator
- There was a GC failure in the online go service. I was in a hurry
- 面试鸭 面试刷题 网站系统源码
- Represent each record in the dataframe as a dictionary
- Solve the problem that Jenkins cannot save the configuration after upgrading
- 2022-2028 global cooling on-off valve industry research and trend analysis report
- Multiplication and addition of univariate polynomial (20 points)
- Figure neural network and cognitive reasoning - Tang Jie - Tsinghua University
- Flutter returns to the black screen of the previous page
猜你喜欢

Haidilao is expected to have an annual net loss of 3.8 billion to 4.5 billion and close more than 300 stores

Eureka的TimedSupervisorTask类(自动调节间隔的周期性任务)

Illustration of Google V8 16: how does V8 improve function execution efficiency through inline caching?

移动应用开发总结
![[yuanuniverse 3D competition]](/img/5e/386d2299ba62a78bd73982997d4df9.png)
[yuanuniverse 3D competition]

CTF show WEB10

2021-07-28 STM32F103 I2C Hardware Transfer Include previous IO Clock EXIT USB use firmware library

There was a GC failure in the online go service. I was in a hurry

Weekly update | showmebug officially launched Tencent conference audio and video

Three methods of bean instantiation
随机推荐
使用Lua+Redis+OpenResty实现电商首页并发优化
Scientific research information | national natural conclusion regulations: more than 50% of the fund balance or it will not be concluded
华三IPsec
Linux安装达梦数据库/DM8(附带客户端工具安装完整版)
结构体类型的三种声明方式
Talk about MySQL's locking rule "hard hitting MySQL series 15"
2021-07-28 STM32F103 I2C Hardware Transfer Include previous IO Clock EXIT USB use firmware library
Eureka的TimedSupervisorTask类(自动调节间隔的周期性任务)
[visualization - source code reading] antvis / g-base interpretation - 1
面试经验---字节
為什呢代碼沒報錯但是數據庫裏邊的數據顯示不出來
2021-07-28 STM32F103配置信息
Cobaltstrike office macro virus utilization
General business plan
Permission management
Why is there no error in the code, but the data in the database cannot be displayed
怎么搭建深度学习框架?
Upgrade Jenkins steps and problems encountered
RISC-V 的MMU
Three methods of bean instantiation