Created
July 14, 2016 01:20
-
-
Save hellofromtonya/96e6cfa31e43040c2a37640eac4191ca to your computer and use it in GitHub Desktop.
Using the theme's information to populate the constants instead of duplicating it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Theme initialization | |
* | |
* @package KnowTheCode\Developers | |
* @since 1.0.0 | |
* @author hellofromTonya | |
* @link https://knowthecode.io | |
* @license GNU General Public License 2.0+ | |
*/ | |
namespace KnowTheCode\Developers; | |
/** | |
* Initialize the theme's constants. | |
* | |
* @since 1.0.0 | |
* | |
* @return void | |
*/ | |
function init_constants() { | |
$child_theme = wp_get_theme(); | |
define( 'CHILD_THEME_NAME', $child_theme->get( 'Name' ) ); | |
define( 'CHILD_THEME_URL', $child_theme->get( 'ThemeURI' ) ); | |
define( 'CHILD_THEME_VERSION', $child_theme->get( 'Version' ) ); | |
define( 'CHILD_TEXT_DOMAIN', $child_theme->get( 'TextDomain' ) ); | |
} | |
init_constants(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment