Jetpack::is_plugin_active PHP Метод

is_plugin_active() публичный статический Метод

We don't want to store these in a static variable, in case there are switch_to_blog() calls involved.
public static is_plugin_active ( $plugin = 'jetpack/jetpack.php' )
    public static function is_plugin_active($plugin = 'jetpack/jetpack.php')
    {
        return in_array($plugin, self::get_active_plugins());
    }

Usage Example

 protected function format_plugin($plugin_file, $plugin_data)
 {
     $plugin = array();
     $plugin['id'] = preg_replace("/(.+)\\.php\$/", "\$1", $plugin_file);
     $plugin['slug'] = Jetpack_Autoupdate::get_plugin_slug($plugin_file);
     $plugin['active'] = Jetpack::is_plugin_active($plugin_file);
     $plugin['name'] = $plugin_data['Name'];
     $plugin['plugin_url'] = $plugin_data['PluginURI'];
     $plugin['version'] = $plugin_data['Version'];
     $plugin['description'] = $plugin_data['Description'];
     $plugin['author'] = $plugin_data['Author'];
     $plugin['author_url'] = $plugin_data['AuthorURI'];
     $plugin['network'] = $plugin_data['Network'];
     $plugin['update'] = $this->get_plugin_updates($plugin_file);
     $plugin['next_autoupdate'] = date('Y-m-d H:i:s', wp_next_scheduled('wp_maybe_auto_update'));
     $autoupdate = in_array($plugin_file, Jetpack_Options::get_option('autoupdate_plugins', array()));
     $plugin['autoupdate'] = $autoupdate;
     $autoupdate_translation = in_array($plugin_file, Jetpack_Options::get_option('autoupdate_plugins_translations', array()));
     $plugin['autoupdate_translation'] = $autoupdate || $autoupdate_translation;
     $plugin['uninstallable'] = is_uninstallable_plugin($plugin_file);
     if (!empty($this->log[$plugin_file])) {
         $plugin['log'] = $this->log[$plugin_file];
     }
     return $plugin;
 }
All Usage Examples Of Jetpack::is_plugin_active
Jetpack