Exemplo n.º 1
0
/**
 * What are the mime types allowed by admin ?
 *
 * @param  array $allowed_file_types WordPress default
 * @uses bp_get_option() to get the choice of the admin
 * @return array the mime types allowed by admin
 */
function buddydrive_allowed_file_types($allowed_file_types)
{
    // Get allowed extensions
    $allowed_ext = buddydrive_get_allowed_upload_exts();
    if (empty($allowed_ext) || !is_array($allowed_ext) || count($allowed_ext) < 1) {
        return $allowed_file_types;
    }
    $allowed_ext = array_flip($allowed_ext);
    $allowed_ext = array_intersect_key($allowed_file_types, $allowed_ext);
    return $allowed_ext;
}
 /**
  * The constuctor
  *
  * @since 1.3.0
  */
 public function __construct()
 {
     parent::__construct(array('action' => 'buddydrive_upload', 'file_input' => 'buddyfile-upload', 'base_dir' => 'buddydrive', 'upload_error_strings' => buddydrive_get_upload_error_strings(), 'allowed_mime_types' => buddydrive_get_allowed_upload_exts()));
 }