Last active
July 25, 2019 19:36
-
-
Save mintplugins/cac5162afa0ea31444fdb7fc052b55cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_dir_and_filename_of_active_plugin( $plugin_filename = 'akismet.php' ) { | |
$plugin_dir_and_filename = false; | |
$active_plugins = get_option( 'active_plugins' ); | |
foreach ( $active_plugins as $active_plugin ) { | |
if ( false !== strpos( $active_plugin, $plugin_filename ) ) { | |
$plugin_dir_and_filename = $active_plugin; | |
break; | |
} | |
} | |
return $plugin_dir_and_filename; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment