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
<?php
defined( 'ABSPATH' ) || exit();
class WC_Stripe_Install {
public static function init() {
add_filter( 'plugin_action_links_' . WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'plugin_action_links' ) );
register_activation_hook( WC_STRIPE_PLUGIN_NAME, array( __CLASS__, 'install' ) );
}
public static function install() {
update_option( 'stripe_wc_version', stripe_wc()->version() );
stripe_wc()->scheduled_actions();
}
public static function plugin_action_links( $links ) {
$action_links = array(
'settings' => sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=stripe_api' ), esc_html__( 'Settings', 'woo-stripe-payment' ) ),
'docs' => sprintf( '<a target="_blank" href="https://docs.paymentplugins.com/wc-stripe/config">%s</a>', __( 'Documentation', 'woo-stripe-payment' ) ),
);
return array_merge( $action_links, $links );
}
}
WC_Stripe_Install::init();