bp_document_allowed_mimes( Array $existing_mimes = array() )
Mine type for uploader allowed by buddyboss document for security reason.
Description
Parameters
- $existing_mimes
-
(Optional) carry mime information.
Default value: array()
Return
(Array)
Source
File: bp-document/bp-document-functions.php
1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 | function bp_document_allowed_mimes( $existing_mimes = array () ) { if ( bp_is_active( 'media' ) ) { $existing_mimes = array (); $all_extensions = bp_document_extensions_list(); foreach ( $all_extensions as $extension ) { if ( isset( $extension [ 'is_active' ] ) && true === (bool) $extension [ 'is_active' ] ) { $extension_name = ltrim( $extension [ 'extension' ], '.' ); $existing_mimes [ "$extension_name" ] = $extension [ 'mime_type' ]; } } } return $existing_mimes ; } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.4.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.