Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This one is for allowing WP for these particular file types*/
- add_filter( 'upload_mimes', function ( $mime_types ) {
- $mime_types[ 'vcf' ] = 'image/svg+xml';
- return $mime_types;
- } );
- /* This is for the WPUF file upload field to accept the custom file type*/
- add_filter( 'wpuf_allowed_extensions', 'wpufe_custom_upload_extensions', 100 );
- function wpufe_custom_upload_extensions( $extensions ) {
- $extensions = array(
- 'images' => array(
- 'ext' => '',
- 'label' => __( 'Images', 'wpuf-pro' )
- ),
- 'audio' => array(
- 'ext' => '',
- 'label' => __( 'Audio', 'wpuf-pro' )
- ),
- 'video' => array(
- 'ext' => '',
- 'label' => __( 'Videos', 'wpuf-pro' )
- ),
- 'pdf' => array(
- 'ext' => '',
- 'label' => __( 'PDF', 'wpuf-pro' )
- ),
- 'office' => array(
- 'ext' => '',
- 'label' => __( 'Office Documents', 'wpuf-pro' )
- ),
- 'zip' => array(
- 'ext' => '',
- 'label' => __( 'Zip Archives', 'wpuf-pro' )
- ),
- 'exe' => array(
- 'ext' => '',
- 'label' => __( 'Executable Files', 'wpuf-pro' )
- ),
- 'csv' => array(
- 'ext' => '',
- 'label' => __( 'CSV', 'wpuf-pro' )
- ),
- 'custom' => array(
- 'label' => __( 'Custom Extensions', 'wpuf-pro' ),
- 'ext' => 'eps,svg,ai'
- )
- );
- return $extensions;
- }
- /**
- Then visit WP-content/plugins/wpuf-pro/includes/fields/class-field-file.php, line number 139:
- then insert the line below:
- 'custom' => __('custom', 'wpuf-pro')
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement