Created
December 10, 2011 00:22
-
-
Save evansolomon/1453969 to your computer and use it in GitHub Desktop.
Do something when a WordPress user uploads a video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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