wphooks.info - validate_current_theme

validate_current_theme

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/theme.php:
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
 * @return bool
 */
function validate_current_theme() {
	/**
	 * Filters whether to validate the current theme.
	 *
	 * @since 2.7.0
	 *
	 * @param bool $validate Whether to validate the current theme. Default true.
	 */
	if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) {
		return true;
	}

	if ( ! file_exists( get_template_directory() . '/index.php' ) ) {
		// Invalid.
	} elseif ( ! file_exists( get_template_directory() . '/style.css' ) ) {
		// Invalid.
	} elseif ( is_child_theme() && ! file_exists( get_stylesheet_directory() . '/style.css' ) ) {
		// Invalid.