Re-order init file
This commit is contained in:
26
lib/init.php
26
lib/init.php
@@ -3,19 +3,6 @@
|
||||
* Roots initial setup and constants
|
||||
*/
|
||||
|
||||
// Backwards compatibility for older than PHP 5.3.0
|
||||
if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
|
||||
|
||||
// Define helper constants
|
||||
$get_theme_name = explode('/themes/', get_template_directory());
|
||||
|
||||
define('WP_BASE', wp_base_dir());
|
||||
define('THEME_NAME', next($get_theme_name));
|
||||
define('RELATIVE_PLUGIN_PATH', str_replace(site_url() . '/', '', plugins_url()));
|
||||
define('FULL_RELATIVE_PLUGIN_PATH', WP_BASE . '/' . RELATIVE_PLUGIN_PATH);
|
||||
define('RELATIVE_CONTENT_PATH', str_replace(site_url() . '/', '', content_url()));
|
||||
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);
|
||||
|
||||
function roots_setup() {
|
||||
|
||||
// Make theme available for translation
|
||||
@@ -40,3 +27,16 @@ function roots_setup() {
|
||||
}
|
||||
|
||||
add_action('after_setup_theme', 'roots_setup');
|
||||
|
||||
// Backwards compatibility for older than PHP 5.3.0
|
||||
if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
|
||||
|
||||
// Define helper constants
|
||||
$get_theme_name = explode('/themes/', get_template_directory());
|
||||
|
||||
define('WP_BASE', wp_base_dir());
|
||||
define('THEME_NAME', next($get_theme_name));
|
||||
define('RELATIVE_PLUGIN_PATH', str_replace(site_url() . '/', '', plugins_url()));
|
||||
define('FULL_RELATIVE_PLUGIN_PATH', WP_BASE . '/' . RELATIVE_PLUGIN_PATH);
|
||||
define('RELATIVE_CONTENT_PATH', str_replace(site_url() . '/', '', content_url()));
|
||||
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);
|
||||
|
||||
Reference in New Issue
Block a user