-
Notifications
You must be signed in to change notification settings - Fork 2
/
woocommerce-gateway-payfabric.php
57 lines (50 loc) · 1.58 KB
/
woocommerce-gateway-payfabric.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Plugin Name: WooCommerce PayFabric Gateway
* Plugin URI: https://github.com/PayFabric/WooCommerce-Plugin
* Description: WooCommerce PayFabric Gateway integration.
* Version: 2.0.0
* Author: PayFabric
*/
/**
* Abort if the file is called directly
*/
if (!defined('WPINC')) {
exit;
}
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-payfabric-gateway-woocommerce-activator.php
*/
function activate_payfabric_gateway_woocommerce()
{
require_once plugin_dir_path(__FILE__) . 'classes/class-payfabric-gateway-woocommerce-activator.php';
Payfabric_Gateway_Woocommerce_Activator::activate();
}
register_activation_hook(__FILE__, 'activate_payfabric_gateway_woocommerce');
/**
* Run the plugin after all plugins are loaded
*/
add_action('plugins_loaded', 'init_payfabric_gateway', 0);
function init_payfabric_gateway()
{
if (!class_exists('WC_Payment_Gateway')) {
return;
}
/**
* Require class and init to register all hooks.
*
* @since 1.0.0
*/
require plugin_dir_path(__FILE__) . 'classes/class-payfabric-gateway-woocommerce.php';
Payfabric_Gateway_Woocommerce::get_instance();
}
// Add custom action links
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'payfabric_gateway_action_links');
function payfabric_gateway_action_links($links)
{
$plugin_links = array(
'<a href="' . admin_url('admin.php?page=wc-settings&tab=checkout§ion=payfabric') . '">' . __('Settings', 'payfabric') . '</a>',
);
return array_merge($plugin_links, $links);
}