Skip to content

Commit

Permalink
[FEAT] allow csv upload
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrillbolliger committed Sep 18, 2023
1 parent de35b99 commit 12f9ec2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wordpress/wp-content/themes/les-verts/lib/admin/leverage-caps.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,16 @@

return $caps;
}, 1, 2 );

/**
* Allow upload of CSV files for any user with upload_files capability
*
* Required for events calendar event import.
*/
add_filter( 'upload_mimes', function ( $allowed_mime_types ) {
if ( current_user_can( 'upload_files' ) ) {
$allowed_mime_types['csv'] = 'text/csv';
}

return $allowed_mime_types;
} );

0 comments on commit 12f9ec2

Please sign in to comment.