[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
WordPress dependencies
File Size: | 711 lines (23 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
MediaUpload:: (2 methods):
getMimeTypesArray()
createMediaFromFile()
Class: MediaUpload - X-Ref
getMimeTypesArray(wpMimeTypesObject) X-Ref |
Browsers may use unexpected mime types, and they differ from browser to browser. This function computes a flexible array of mime types from the mime type structured provided by the server. Converts { jpg|jpeg|jpe: "image/jpeg" } into [ "image/jpeg", "image/jpg", "image/jpeg", "image/jpe" ] The computation of this array instead of directly using the object, solves the problem in chrome where mp3 files have audio/mp3 as mime type instead of audio/mpeg. https://bugs.chromium.org/p/chromium/issues/detail?id=227004 param: {?Object} wpMimeTypesObject Mime type object received from the server. return: {?Array} An array of mime types or the parameter passed if it was "falsy". |
createMediaFromFile(file, additionalData) X-Ref |
param: {File} file Media File to Save. param: {?Object} additionalData Additional data to include in the request. return: {Promise} Media Object Promise. |
Generated : Sat May 11 08:20:01 2024 | Cross-referenced by PHPXref |