Use SERVER_NAME to avoid parsing site_url()

site_url() was previously retrieved and parsed many times per page
before. This is cleaner and done for optimization purposes.
This commit is contained in:
Scott Walkinshaw
2013-05-09 17:04:26 -04:00
parent 679fe6829c
commit 9ac6bc698e
2 changed files with 5 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
// Define helper constants
$get_theme_name = explode('/themes/', get_template_directory());
define('THEME_NAME', next($get_theme_name));
define('RELATIVE_PLUGIN_PATH', str_replace(home_url() . '/', '', plugins_url()));
define('RELATIVE_CONTENT_PATH', str_replace(home_url() . '/', '', content_url()));
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);
define('THEME_NAME', next($get_theme_name));
define('RELATIVE_PLUGIN_PATH', str_replace(home_url() . '/', '', plugins_url()));
define('RELATIVE_CONTENT_PATH', str_replace(home_url() . '/', '', content_url()));
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);