Skip to content

Commit

Permalink
Fixed isPlugin
Browse files Browse the repository at this point in the history
Added Hook
  • Loading branch information
Jakiboy committed May 17, 2020
1 parent 929f64b commit c449db8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jakiboy/vanilleplugin",
"version" : "0.0.6",
"version" : "0.0.7",
"type": "library",
"description": "Framwork for VanillePlugin",
"keywords": ["VanillePlugin","WordPress","WordPress-Plugin","WordPress-Plugin-Framework","jakiboy"],
Expand Down
12 changes: 9 additions & 3 deletions src/lib/PluginOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,20 @@ protected function getPluginInfo($file)
}

/**
* Return plugin
* Return plugin active
*
* @param string $file {pluginDir}/{pluginMain}.php
* @return array
* @return boolean
*/
protected function isPlugin($file)
{
return is_plugin_active($file);
if ( function_exists('is_plugin_active') ) {
return is_plugin_active($file);
} else {
$plugins = $this->applyFilter('active_plugins', $this->getOption('active_plugins'));
return in_array($file, $plugins);
}
return false;
}

/**
Expand Down

0 comments on commit c449db8

Please sign in to comment.