Skip to content

Instantly share code, notes, and snippets.

@joehoyle
Created September 11, 2012 14:06
Show Gist options
  • Save joehoyle/3698740 to your computer and use it in GitHub Desktop.
Save joehoyle/3698740 to your computer and use it in GitHub Desktop.
add_filter( 'wpthumb_post_image_path', $f = function( $path ) {
$dir = wp_upload_dir();
$num = rand( 0, 2 );
$path = $dir['basedir'] . "/test$num.jpg";
return $path;
});
add_filter( 'get_attached_file', $f );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment