Skip to content

Instantly share code, notes, and snippets.

@Apina
Created November 15, 2013 07:57
Show Gist options
  • Save Apina/7480735 to your computer and use it in GitHub Desktop.
Save Apina/7480735 to your computer and use it in GitHub Desktop.
Remove gateways by event ID Please note that if you want to do this with other gateways, you will need to check the action hook in each gateway as they may well be slightly different (e.g. invoice doesn't currently have the _2 at the end).
function htrappfae_remove_check_from_event($payment_data) {
extract( $payment_data );
if ( $event_id==8) { //check to see if this is the event with the ID of #8
//echo "Event Espresso ID: $event_id";
remove_action('action_hook_espresso_display_offline_payment_gateway_2','espresso_display_check' );
remove_action('action_hook_espresso_display_offline_payment_gateway_2', 'espresso_display_purchase_order');
}
}
add_action ( 'action_hook_espresso_display_offline_payment_gateway', 'htrappfae_remove_check_from_event',9 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment