Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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