Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save wbcomdev/f820b24ff3ec1ea37914cd9309c5a67b to your computer and use it in GitHub Desktop.

Select an option

Save wbcomdev/f820b24ff3ec1ea37914cd9309c5a67b to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: WooCommerce <enter name> Gateway
* Plugin URI: https://wbcomdesigns.com/
* Description: Extends WooCommerce with an <enter name> gateway.
* Version: 1.0
* Author: Wbcomdesigns
* Author URI: https://wbcomdesigns.com/
*/
function wb_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 wb_woocommerce_add_gateway_name_gateway( $methods ) {
$methods[] = 'WC_Gateway_Name';
return $methods;
}
add_filter( 'woocommerce_payment_gateways', 'wb_woocommerce_add_gateway_name_gateway' );
}
add_action( 'plugins_loaded', 'wb_woocommerce_gateway_name_init', 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment