関数 validate_current_theme()
2014/12/17
関数 validate_current_theme()
定義ファイル :/blog/wp-includes/theme.php 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | function validate_current_theme() { /** * Filter whether to validate the current theme. * * @since 2.7.0 * * @param bool true Validation flag to check the current theme. */ if ( defined('WP_INSTALLING') || ! apply_filters( 'validate_current_theme', true ) ) return true; if ( get_template() != WP_DEFAULT_THEME && !file_exists(get_template_directory() . '/index.php') ) { switch_theme( WP_DEFAULT_THEME ); return false; } if ( get_stylesheet() != WP_DEFAULT_THEME && !file_exists(get_template_directory() . '/style.css') ) { switch_theme( WP_DEFAULT_THEME ); return false; } if ( is_child_theme() && ! file_exists( get_stylesheet_directory() . '/style.css' ) ) { switch_theme( WP_DEFAULT_THEME ); return false; } return true; } |