コード例 #1
0
 static function init()
 {
     self::$active_plugins = (array) get_option('active_plugins', array());
     if (is_multisite()) {
         self::$active_plugins = array_merge(self::$active_plugins, get_site_option('active_sitewide_plugins', array()));
     }
 }
コード例 #2
0
function woocommerce_paytpv_init()
{
    /**
     * Required functions
     */
    if (!class_exists('WC_Payment_Gateway') || !WC_PayTpv_Dependencies::woocommerce_active_check()) {
        return;
    }
    load_plugin_textdomain('wc_paytpv', false, dirname(plugin_basename(__FILE__)) . '/languages');
    add_filter('woocommerce_payment_gateways', 'add_paytpv_gateway');
    /**
     * Add the gateway to woocommerce
     * */
    function add_paytpv_gateway($methods)
    {
        $methods[] = 'woocommerce_paytpv';
        return $methods;
    }
    register_activation_hook(__FILE__, 'paytpv_install');
    require PAYTPV_PLUGIN_DIR . '/inc/woocommerce-paytpv.php';
}