Skip to content

Commit 7e069a9

Browse files
committed
Add a filter comparable to validate_theme_requirement
1 parent 458daed commit 7e069a9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/wp-admin/includes/plugin.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,20 @@ function validate_plugin_requirements( $plugin ) {
12471247
);
12481248
}
12491249

1250-
return true;
1250+
/**
1251+
* Filters the plugin requirement validation response.
1252+
*
1253+
* If a plugin fails due to a Core-provided validation (incompatible WP, PHP versions), this
1254+
* filter will not fire. A WP_Error response will already be returned.
1255+
*
1256+
* This filter is intended to add additional validation steps by site administrators.
1257+
*
1258+
* @since 6.9.0
1259+
*
1260+
* @param bool|WP_Error $met_requirements True if the plugin meets requirements, WP_Error if not.
1261+
* @param string $plugin Path to the plugin file relative to the plugins directory.
1262+
*/
1263+
return apply_filters( 'validate_plugin_requirements', true, $plugin );
12511264
}
12521265

12531266
/**

0 commit comments

Comments
 (0)