Last active
January 15, 2025 18:43
Revisions
-
rickalday revised this gist
Jan 15, 2025 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,12 +25,11 @@ function givewp_export_subcription_id_field() { add_action( 'give_export_donation_standard_payment_fields', 'givewp_export_subcription_id_field' ); function givewp_export_subcription_id_data( $data, $payment, $columns, $instance ) { // subscriptions and renewals will have the subscription_id metakey $subscription_payment = $payment->get_meta( 'subscription_id' ); if ( ! empty( $columns['givewp_subscription_id'] )) { if ( $subscription_payment ) { $data['givewp_subscription_id'] = $subscription_payment ; } else { $data['givewp_subscription_id'] = ''; } -
rickalday revised this gist
Jan 15, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function givewp_export_subcription_id_field() { function givewp_export_subcription_id_data( $data, $payment, $columns, $instance ) { // update donation payment type $subscription_payment = $payment->get_meta( 'subscription_id' ); if ( ! empty( $columns['givewp_subscription_id'] ) || 'give_subscription' === $payment->status ) { $subscription = give_recurring_get_subscription_by( 'payment', $payment->ID ); if ( $subscription_payment ) { -
rickalday created this gist
Jan 14, 2025 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ <?php function givewp_subscription_columns_name( $cols ) { if ( isset( $cols['givewp_subscription_id'] ) ) { $cols['givewp_subscription_id'] = __( 'Subscription ID', 'give' ); } return $cols; } add_filter( 'give_export_donation_get_columns_name', 'givewp_subscription_columns_name' ); function givewp_export_subcription_id_field() { ?> <li> <label for="give-export-subscription-id"> <input type="checkbox" checked name="give_give_donations_export_option[givewp_subscription_id]" id="give-export-subscription-id"><?php _e( 'Subscription ID', 'give-recurring' ); ?> </label> </li> <?php } add_action( 'give_export_donation_standard_payment_fields', 'givewp_export_subcription_id_field' ); function givewp_export_subcription_id_data( $data, $payment, $columns, $instance ) { // update donation payment type $subscription_payment = $payment->get_meta( '_give_subscription_payment' ); if ( ! empty( $columns['givewp_subscription_id'] ) || 'give_subscription' === $payment->status ) { $subscription = give_recurring_get_subscription_by( 'payment', $payment->ID ); if ( $subscription_payment ) { $data['givewp_subscription_id'] = $subscription->id; } else { $data['givewp_subscription_id'] = ''; } } return $data; } add_filter( 'give_export_donation_data', 'givewp_export_subcription_id_data', 20, 4 );