-
-
Save hpoom/1717604 to your computer and use it in GitHub Desktop.
WordPress plugin for Orchestra.io to set the upload path to sys_get_temp_dir().
This file contains hidden or 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 | |
/* | |
Plugin Name: Orchestra.io Upload to Temp | |
Plugin URI: | |
Description: Sets the upload path to sys_get_temp_dir(), allowing uploads to be stored temporarily, presumably before being moved elsewhere (like Amazon S3 via the tantan-s3 plugin). | |
Version: 0.1 | |
Author: Dylan Kuhn | |
Author URI: http://www.cyberhobo.net/ | |
Minimum WordPress Version Required: 3.0 | |
License: GPL2+ | |
*/ | |
/* Copyright 2011 Dylan Kuhn (email : [email protected]) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License, version 2 or later, as | |
published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with this program; if not, write to the Free Software | |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
add_filter( 'option_upload_path', array( 'OrchestraUploadToTemp', 'filter_option_upload_path' ) ); | |
class OrchestraUploadToTemp { | |
static public function filter_option_upload_path( $upload_path ) { | |
return sys_get_temp_dir(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment