This file contains hidden or 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 characters
| <?php | |
| /** | |
| * Plugin Name: TEC - Rebuild missing Custom Tables row on event update | |
| * Description: When an event with no wp_tec_events row is updated, repairs its date meta and rebuilds its Custom Tables rows. Logs "[TEC CT1 rebuild]" lines to the PHP error log. | |
| * | |
| * TEC: rebuild a missing Custom Tables row when an event is updated. | |
| * | |
| * Works as a Code Snippet (paste without the opening <?php line) or as a must-use plugin | |
| * (copy this file to wp-content/mu-plugins/). Use one or the other, not both. | |
| * |
This file contains hidden or 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 characters
| <?php | |
| function delete_givewp_user( $donor ) { | |
| wp_delete_user( $donor->userId ); | |
| } | |
| add_action( 'givewp_donor_user_created', 'delete_givewp_user', 10 ); |
This file contains hidden or 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 characters
| <?php | |
| use Give\Framework\FieldsAPI\Text; | |
| use Give\Framework\FieldsAPI\Checkbox; | |
| add_action('givewp_donation_form_schema', function($form, $formId) { | |
| //Middle name field | |
| $middlename = Text::make('middlename') | |
| ->showInReceipt() | |
| ->required() | |
| ->storeAsDonorMeta() |
This file contains hidden or 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 characters
| <?php | |
| add_action( 'init', function () { | |
| remove_shortcode( 'give_donor_wall' ); | |
| add_shortcode( 'give_donor_wall', 'my_safe_give_donor_wall_shortcode' ); | |
| }, 100 ); | |
| function my_safe_give_donor_wall_shortcode( $atts = [] ) { | |
| $atts = shortcode_atts( | |
| [ | |
| 'donors_per_page' => 12, |
This file contains hidden or 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 characters
| <?php | |
| add_filter( 'learndash_notifications_are_triggering_objects_valid', 'ldn_require_same_wpml_language_after_compat', 9999, 4 ); | |
| function ldn_require_same_wpml_language_after_compat( $valid, $trigger, $notification, $args ) { | |
| // Only act when the notification was already considered valid. | |
| if ( ! $valid ) { | |
| return $valid; | |
| } | |
| if ( ! is_object( $notification ) || ! is_array( $args ) ) { | |
| return $valid; |
This file contains hidden or 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 characters
| <?php | |
| function give_time_email_tag( $email_tags ) { | |
| // Adds an email tag called {time} to output the donation time. | |
| $email_tags[] = array( | |
| 'tag' => 'time', // The tag name. | |
| 'desc' => __( 'This outputs the donation time', 'give' ), // For admins. | |
| 'func' => 'render_time_email_tag', // Callback to function below. | |
| 'context' => 'donation', | |
| ); |
This file contains hidden or 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 characters
| <?php | |
| function free_custom_export_users() { | |
| if ( isset( $_GET['export_my_users'] ) && current_user_can( 'manage_options' ) ) { | |
| header('Content-Type: text/csv; charset=utf-8'); | |
| header('Content-Disposition: attachment; filename=users_export.csv'); | |
| $output = fopen('php://output', 'w'); | |
| // Define your column headers here (Add your custom field names) |
This file contains hidden or 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 characters
| <?php | |
| use Give\Framework\FieldsAPI\Text; | |
| add_action('givewp_donation_form_schema', function($form, $formId) { | |
| //Country field | |
| $country = Text::make('country') | |
| ->showInReceipt() | |
| ->receiptLabel(__('Country', 'give-tributes')) | |
| ->label(__('Country', 'give-tributes')) |
This file contains hidden or 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 characters
| <?php | |
| add_filter('give_export_get_data_donors', function($exportData) { | |
| global $wpdb; | |
| /** | |
| * Map of output column names to their meta key prefixes | |
| */ | |
| $addressFields = [ | |
| 'address_line1' => '_give_donor_address_billing_line1', |
This file contains hidden or 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 characters
| <?php | |
| add_filter( 'give_api_donations_endpoint', function( $donations ) { | |
| // Check if donations array has the expected structure | |
| if ( ! isset( $donations['donations'] ) || ! is_array( $donations['donations'] ) ) { | |
| return $donations; | |
| } | |
| // Loop through each donation and add the fund title | |
| foreach ( $donations['donations'] as $key => &$donation ) { |
NewerOlder