Skip to content

Instantly share code, notes, and snippets.

@franz-josef-kaiser
Created March 9, 2012 17:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save franz-josef-kaiser/2007615 to your computer and use it in GitHub Desktop.
Save franz-josef-kaiser/2007615 to your computer and use it in GitHub Desktop.
Change WP Directory Names
<?php
/**
* Plugin Name: Alternatives Themes Dir
* Plugin URI: http://unserkaiser.com
* Description: Changes the themes directory to <code>/apps</code>
* Version: 0.1
* Author: Franz Josef Kaiser
* Author URI: http://unserkaiser.com
*/
// Prevent loading this file directly - Busted!
if( ! class_exists('WP') )
{
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
function register_apps_folder()
{
register_theme_directory( 'apps' );
}
add_action( 'plugins_loaded', 'register_apps_folder', 0 );
<?php
// !IMPORTANT! Must be set in wp-config.php
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) )
define( 'ABSPATH', dirname( __FILE__ ).'/' );
define( 'HOST_NAME ', 'example.com' );
define( 'WP_SITEURL', 'http://'.HOST_NAME );
define( 'WP_HOME', 'http://'.HOST_NAME );
define( 'WP_CONTENT_FOLDERNAME', 'content' );
define( 'WP_PLUGINS_FOLDERNAME', '/pluuugins' );
define( 'WP_MUPLUGINS_FOLDERNAME', '/mu-pluuugins' );
define( 'WP_CONTENT_DIR', ABSPATH.WP_CONTENT_FOLDERNAME );
define( 'WP_CONTENT_URL', WP_SITEURL.'/'.WP_CONTENT_FOLDERNAME );
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR.WP_PLUGINS_FOLDERNAME );
define( 'PLUGINDIR', WP_CONTENT_FOLDERNAME.'/'.WP_PLUGINS_FOLDERNAME );
define( 'WP_PLUGIN_URL', WP_CONTENT_URL.WP_PLUGINS_FOLDERNAME );
define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR.WP_MUPLUGINS_FOLDERNAME );
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL.WP_MUPLUGINS_FOLDERNAME );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment