Skip to content

Instantly share code, notes, and snippets.

View Luminus's full-sized avatar

Luminus Olumide Alabi Luminus

View GitHub Profile
@madeincosmos
madeincosmos / functions.php
Created May 23, 2019 10:11
Add customer username and ID to WooCommerce emails
add_filter( 'woocommerce_email_customer_details_fields', 'add_user_id_to_woocommerce_emails', 10, 3);
function add_user_id_to_woocommerce_emails( $fields, $sent_to_admin, $order ) {
$user_id = $order->get_customer_id();
$user_info = get_userdata( $user_id );
$fields['user_id'] = array(
'label' => __( 'User ID', 'woocommerce' ),
'value' => $user_id
);
@jrick1229
jrick1229 / wcs_remove_cancel_button_MIN.php
Last active July 2, 2020 16:32
Hide the 'Cancel' button until the payment count reaches '12'.
<?php
function wcs_remove_cancel_button_MIN ( $actions, $subscription ) {
if ( $subscription->get_completed_payment_count() >= 12 ) {
return $actions;
}
unset( $actions['cancel'] );
return $actions;
}
add_filter( 'wcs_view_subscription_actions', 'wcs_remove_cancel_button_MIN', 100, 2 );
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active April 22, 2025 22:44
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

@madeincosmos
madeincosmos / functions.php
Created August 19, 2019 13:04
Send billing address to PayPal even when shipping is disabled
/* Send billing address to PayPal even when shipping is disabled (2278024-zen) */
add_filter( 'woocommerce_paypal_args', 'force_send_billing_address_to_paypal', 10 );
function force_send_billing_address_to_paypal ( $args ) {
$args[ 'no_shipping' ] = 0;
return $args;
}
@danielbitzer
danielbitzer / file.php
Last active May 18, 2023 15:31
AutomateWoo - Action function to change subscription next payment date
<?php
/**
* AutomateWoo action function to extend a subscription by 3 months.
*
* A note will be added to the subscription.
*
* Ensures that the dates near the end of the month are logically handled and do not shift to the start of the following month.
*
* Custom action function docs: https://automatewoo.com/docs/actions/custom-functions/
*