ap_allowed_mimes()
Description #
Return allowed mime types.
Source #
File: includes/upload.php
function ap_allowed_mimes() {
$allowed = ap_opt( 'allowed_file_mime' );
if ( empty( $allowed ) ) {
$allowed = '';
}
// Convert to array split by new line and =>.
$allowed = explode( "\n", $allowed );
$mimes = array();
if ( ! empty( $allowed ) ) {
foreach ( $allowed as $a ) {
$a = explode( '=>', $a );
if ( ! isset( $a[1] ) || empty( $a[0] ) || empty( $a[1] ) ) {
continue;
}
$mimes[ trim( $a[0] ) ] = trim( $a[1] );
}
}
/**
* Filter allowed mimes types.
*
* @param array $mimes Default mimes types.
* @since 3.0.0
*/
return apply_filters( 'ap_allowed_mimes', $mimes );
}
Expand full source code Collapse full source code View on GitHub: includes/upload.php:358
Add your comment