Last active
November 13, 2020 09:15
-
-
Save ypadd/212ab74a98df0f0f8ee3d0190bc5c9ba to your computer and use it in GitHub Desktop.
[WooCommerce Gateway] Plugin Base für Woocommerce Payment Gateway #Woocommerce #Plugin
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
<?php | |
/* | |
Plugin Name: WooCommerce <enter name> Gateway | |
Plugin URI: http://woothemes.com/woocommerce | |
Description: Extends WooCommerce with an <enter name> gateway. | |
Version: 1.0 | |
Author: WooThemes | |
Author URI: http://woothemes.com/ | |
Copyright: © 2009-2011 WooThemes. | |
License: GNU General Public License v3.0 | |
License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
add_action('plugins_loaded', 'woocommerce_gateway_name_init', 0); | |
function woocommerce_gateway_name_init() { | |
if ( !class_exists( 'WC_Payment_Gateway' ) ) return; | |
/** | |
* Localisation | |
*/ | |
load_plugin_textdomain('wc-gateway-name', false, dirname( plugin_basename( __FILE__ ) ) . '/languages'); | |
/** | |
* Gateway class | |
*/ | |
class WC_Gateway_Name extends WC_Payment_Gateway { | |
// Go wild in here | |
} | |
/** | |
* Add the Gateway to WooCommerce | |
**/ | |
function woocommerce_add_gateway_name_gateway($methods) { | |
$methods[] = 'WC_Gateway_Name'; | |
return $methods; | |
} | |
add_filter('woocommerce_payment_gateways', 'woocommerce_add_gateway_name_gateway' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment