Skip to content

Instantly share code, notes, and snippets.

@wpscholar
Created August 9, 2014 12:51
Show Gist options
  • Save wpscholar/6aeec13682224e0ab093 to your computer and use it in GitHub Desktop.
Save wpscholar/6aeec13682224e0ab093 to your computer and use it in GitHub Desktop.
Sanitize mime type example
<?php
$mime_type = sanitize_mime_type( $_FILES['upload']['type'] );
update_post_meta( get_the_ID(), 'mime_type', $mime_type );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment