WordPress 2.6 allows for moving the wp-content folder and the wp-config.php file. Some code guidelines have been published to help developers standardize their plugins with the new changes. The following code will allow code to work with current versions and the upcoming 2.6.
wp-content
// Pre-2.6 compatibility
if ( !defined('WP_CONTENT_URL') )
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
if ( !defined('WP_CONTENT_DIR') )
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
// Guess the location
$plugin_path = WP_CONTENT_DIR.'/plugins/'. plugin_basename(dirname(__FILE__));
$plugin_url = WP_CONTENT_URL.'/plugins/'. plugin_basename(dirname(__FILE__));
wp-config.php
$root = dirname(dirname(dirname(dirname(__FILE__))));
if (file_exists($root.'/wp-load.php')) {
// WP 2.6
require_once($root.'/wp-load.php');
} else {
// Before 2.6
require_once($root.'/wp-config.php');
}
Did I help you?