[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> media-utils.js (summary)

(no description)

File Size: 787 lines (24 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

media_upload_MediaUpload:: (2 methods):
  getMimeTypesArray()
  createMediaFromFile()

Defines 2 functions

  __webpack_require__()
  getDefault()
  getModuleExports()

Class: media_upload_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

return: {?Array} An array of mime types or the parameter passed if it was "falsy".
param: {?Object} wpMimeTypesObject Mime type object received from the server.

createMediaFromFile(file, additionalData)   X-Ref

return: {Promise} Media Object Promise.
param: {File}    file           Media File to Save.
param: {?Object} additionalData Additional data to include in the request.

Functions
Functions that are not part of a class:

__webpack_require__(moduleId)   X-Ref
No description

getDefault()   X-Ref
No description

getModuleExports()   X-Ref
No description



Generated: Tue Sep 21 01:00:05 2021 Cross-referenced by PHPXref 0.7.1