Skip to content

Instantly share code, notes, and snippets.

View rogercoathup's full-sized avatar

Roger Coathup rogercoathup

View GitHub Profile
@rogercoathup
rogercoathup / reinstate-shipto-address.php
Last active November 22, 2021 01:47
Supports the purchaser entering the recipient address at checkout for a woocommerce-subscriptions-gifting (https://github.com/Prospress/woocommerce-subscriptions-gifting) gift.
<?php
add_action( 'woocommerce_checkout_subscription_created', 'maybe_reinstate_gifting_address', 99, 3 );
/**
* Ugly hack to reinstate the ship to address, if it's been removed by the gifting plugin
* Don't remove if it's an existing user though
* @param [type] $subscription [description]
* @param [type] $order [description]
* @param [type] $recurring_cart [description]
class BuddyDrive_Theme_Compat {
/**
* Setup the BuddyDrive component theme compatibility
*
* @since BuddyDrive (1.0)
*/
public function __construct() {
add_action( 'bp_setup_theme_compat', array( $this, 'is_buddydrive' ) );