Modified get_wp_plugin_id() (#35727)

* Modified get_wp_plugin_id()

* Changelog.

* Use strict comparison per project coding standards.

Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
This commit is contained in:
Jamsheer 2022-11-26 05:52:11 +05:30 committed by GitHub
parent 6b3056422e
commit 9fabda744a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Improves efficiency of code responsible for determining plugin IDs (during feature compatibility checks).

View File

@ -129,7 +129,7 @@ class PluginUtil {
// Try to match plugin_basename(). // Try to match plugin_basename().
$plugin_basename = $this->proxy->call_function( 'plugin_basename', $plugin_file ); $plugin_basename = $this->proxy->call_function( 'plugin_basename', $plugin_file );
if ( array_key_exists( $plugin_basename, $wp_plugins ) ) { if ( in_array( $plugin_basename, $wp_plugins, true ) ) {
return $plugin_basename; return $plugin_basename;
} }