Skip to content

Instantly share code, notes, and snippets.

@xentek
Created July 29, 2011 16:09
Show Gist options
  • Save xentek/1114131 to your computer and use it in GitHub Desktop.
Save xentek/1114131 to your computer and use it in GitHub Desktop.
Override upload_path in WordPress
<?php
/*
Plugin Name: Upload Override
Plugin URI: http://xentek.net/
Description: Override the Upload Path so that it is always set the way you want
Version: 0.1
Author: Eric Marden
Author URI: http://xentek.net/
*/
/**
* Copyright (c) 2011 Eric Marden. All rights reserved.
*
* Released under the GPL license
* http://www.opensource.org/licenses/gpl-license.php
*
* This is an add-on for WordPress
* http://wordpress.org/
*
* **********************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.
* **********************************************************************
*/
add_action('init', 'xen_override_upload');
function xen_override_upload()
{
update_option('upload_path', 'wp-content/uploads'); // Its set to the default now, but you can use a full local path to move this to another location. YMMV
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment