mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Media: Add support for WebP images in the Thickbox library.
This ensures that `.webp` images are properly recognized and displayed in the modal as expected. Follow-up to [50810], [51227], [52073]. Props ilunabar, graham73may, sabernhardt, mukesh27, SergeyBiryukov. Fixes #55786. git-svn-id: https://develop.svn.wordpress.org/trunk@53451 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
10
src/js/_enqueues/vendor/thickbox/thickbox.js
vendored
10
src/js/_enqueues/vendor/thickbox/thickbox.js
vendored
@@ -76,10 +76,16 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
|
||||
baseURL = url;
|
||||
}
|
||||
|
||||
var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
|
||||
var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$|\.webp$/;
|
||||
var urlType = baseURL.toLowerCase().match(urlString);
|
||||
|
||||
if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
|
||||
if(urlType == '.jpg' ||
|
||||
urlType == '.jpeg' ||
|
||||
urlType == '.png' ||
|
||||
urlType == '.gif' ||
|
||||
urlType == '.bmp' ||
|
||||
urlType == '.webp'
|
||||
){//code to show images
|
||||
|
||||
TB_PrevCaption = "";
|
||||
TB_PrevURL = "";
|
||||
|
||||
Reference in New Issue
Block a user