Skip to content

Posted in: General Snippets | View All

Important: Snippet Placement

Allow upload of VCF files (aka vCards)

This snippet registers the VCF file MIME type so that the site will allow vcf files to be uploaded to the WordPress Media Library.

This snippet should be added when the customer wants to share vCards on their website. This is most common on “Team” pages to share contact details, especially for attorneys.

      // Registering the vcf MIME type. This allows vcf files to be uploaded to the media library
function wds_upload_mimes( $existing_mimes ) {
	// Add vcf to the list of mime types.
	$existing_mimes['vcf'] = 'text/vcard';

	// Return the array back to the function with our added mime type.
	return $existing_mimes;
}
add_filter( 'mime_types', 'wds_upload_mimes' );
  

Audit History

Passed | February 24, 2023 | By jcullen

Scroll To Top