Skip to content

Instantly share code, notes, and snippets.

@evansolomon
Created December 10, 2011 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evansolomon/1453969 to your computer and use it in GitHub Desktop.
Save evansolomon/1453969 to your computer and use it in GitHub Desktop.
Do something when a WordPress user uploads a video
<?php
/**
* User uploads a video
*/
function user_uploads_video( $args, $upload ) {
if( 'upload' != $upload )
return;
if( 0 === strpos( $args['type'], 'video' ) ) {
//do cool stuff
}
return $args;
}
add_filter( 'wp_handle_upload', 'user_uploads_video', 10, 2 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment