PluginProbe
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables / 2.1.0
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables v2.1.0
2.3.0 2.2.14 2.2.13 2.2.12 2.2.11 2.2.10 2.2.9 2.2.8 2.2.7 2.2.6 2.2.5 2.2.4 2.2.3 trunk 1.0.0 1.0.1 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2
table-builder-block / includes / Traits / PluginHelper.php

PluginHelper.php in TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables 2.1.0, at includes/Traits/PluginHelper.php

31 lines 680 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TableBuilder\Traits;
4
5 /**
6 * Trait for making singleton instance
7 * This is a factory singleton
8 *
9 * @package TableBuilder\Traits
10 */
11 trait PluginHelper{
12 public static function is_plugin_active( $plugin ) {
13 return in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) || self::is_plugin_active_for_network( $plugin );
14 }
15
16 /**
17 * Check for network plugin active
18 */
19 public static function is_plugin_active_for_network( $plugin ) {
20 if ( ! is_multisite() ) {
21 return false;
22 }
23
24 $plugins = get_site_option( 'active_sitewide_plugins' );
25 if ( isset( $plugins[ $plugin ] ) ) {
26 return true;
27 }
28
29 return false;
30 }
31 }