Skip to content

Commit 15c9632

Browse files
committed
Add validate_theme_requirements filter
1 parent 9d1aa4e commit 15c9632

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/wp-includes/theme.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,20 @@ function validate_theme_requirements( $stylesheet ) {
959959
);
960960
}
961961

962-
return true;
962+
/**
963+
* Filters the theme requirement validation response.
964+
*
965+
* If a theme fails due to a Core-provided validation (incompatible WP, PHP versions), this
966+
* filter will not fire. A WP_Error response will already be returned.
967+
*
968+
* This filter is intended to add additional validation steps by site administrators.
969+
*
970+
* @since 6.0.0
971+
*
972+
* @param bool|WP_Error $met_requirements True if the theme meets requirements, WP_Error if not.
973+
* @param string $stylesheet Directory name for the theme.
974+
*/
975+
return apply_filters( 'validate_theme_requirements', true, $stylesheet );
963976
}
964977

965978
/**

0 commit comments

Comments
 (0)