Created
May 16, 2021 05:18
-
-
Save wbcomdev/f820b24ff3ec1ea37914cd9309c5a67b to your computer and use it in GitHub Desktop.
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: 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