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 | |
$version = 'default'; | |
$stylesheet_dir = get_stylesheet_directory(); | |
if ( file_exists( $stylesheet_dir.'/.git/HEAD' ) ) { | |
$head = explode(' ', trim(file_get_contents($stylesheet_dir.'/.git/HEAD')) ); | |
if ( isset($head[1]) && file_exists($stylesheet_dir.'/.git/'.$head[1]) ) { | |
$version = trim(file_get_contents($stylesheet_dir.'/.git/'.$head[1])); | |
} | |
} | |
define( 'THEME_VERSION', $version ); |
せんせい、4行目に閉じカッコが足りないよ
if ( file_exists( $stylesheet_dir.’/.git/HEAD’ ) ) {