Skip to content

Instantly share code, notes, and snippets.

View mihaijoldis's full-sized avatar

Mihai Joldis mihaijoldis

View GitHub Profile
@mihaijoldis
mihaijoldis / custom_stripe_meta.php
Created March 3, 2022 10:07
Add custom meta data to Stripe transactions.
add_filter( 'edds_create_payment_intent_args', function( $args, $purchase_data ) {
$args['metadata']['custom-field'] = 'My awesome custom data';
return $args;
}, 10, 2 );
@mihaijoldis
mihaijoldis / edd-product-column.php
Created September 7, 2022 11:57
Add Download Product Name Column to EDD Purchase Table in backend
function _edd_payments_table_columns( $columns ) {
$columns['download_name'] = __('Download Name');
return $columns;
}
add_filter( 'edd_payments_table_columns', '_edd_payments_table_columns' );
function _edd_payments_table_column( $value, $payment_ID, $column_name ) {
if( $column_name == 'download_name' ) {
@mihaijoldis
mihaijoldis / edd-order-columns.php
Created November 7, 2022 22:21 — forked from webzunft/edd-order-columns.php
Add Product and Country column to Easy Digital Downloads
<?php
/**
* Add more columns to the order table
*
* - Products
* - Country
*/
/**
* Add table columns
*
@mihaijoldis
mihaijoldis / edd_aa_disable_purchase_renewal.php
Created February 17, 2023 14:41
Disable All Access behaviours so customers can purchase multiple passes at the same time
add_action( 'wp_loaded', 'prefix_disable_aa_purchase_renewal_behaviors' );
/**
* Disable the All Access purchase button behaviors so that a single customer can purchase multiple passes.
*
* @return void
*/
function prefix_disable_aa_purchase_renewal_behaviors() {
if ( ! function_exists( 'edd_all_access' ) ) {
return;
}
@mihaijoldis
mihaijoldis / gist:c70f004cbd468e27385f28eef32af041
Created June 6, 2024 10:56
Mailchimp EDD: add language to customer profile
add_filter( 'edd.mailchimp.customer', 'prefix_update_customer_language' );
/**
* Updates the language of a customer.
*
* @param array $customer The customer object to update.
* @return array
*/
function prefix_update_customer_language( $customer ) {
$customer['language'] = strtolower( get_user_locale() );