/** * This function renders most of the columns in the list table. * * @access public * @since 1.0 * * @param Give_Payment $payment Payment ID. * @param string $column_name The name of the column * * @return string Column Name */ public function column_default($payment, $column_name) { $single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details'))); $row_actions = $this->get_row_actions($payment); switch ($column_name) { case 'donation': ob_start(); ?> <a href="<?php echo $single_donation_url; ?> " data-tooltip="<?php esc_html_e('View details', 'give'); ?> ">#<?php echo $payment->ID; ?> </a> <?php _e('by', 'give'); ?> <?php echo $this->get_donor($payment); ?> <br> <?php echo $this->get_donor_email($payment); ?> <?php echo $this->row_actions($row_actions); ?> <?php $value = ob_get_clean(); break; case 'amount': $amount = !empty($payment->total) ? $payment->total : 0; $value = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID)); break; case 'donation_form': $value = '<a href="' . admin_url('post.php?post=' . $payment->form_id . '&action=edit') . '">' . $payment->form_title . '</a>'; $level = give_get_payment_form_title($payment->meta, true); if (!empty($level)) { $value .= $level; } break; case 'date': $date = strtotime($payment->date); $value = date_i18n(get_option('date_format'), $date); break; case 'status': $value = $this->get_payment_status($payment); break; case 'details': $value = '<div class="give-payment-details-link-wrap"><a href="' . $single_donation_url . '" data-tooltip="' . __('View details', 'give') . '" class="give-payment-details-link button button-small" title="' . __('View Details', 'give') . '"><span class="dashicons dashicons-visibility"></span></a></div>'; break; default: $value = isset($payment->{$column_name}) ? $payment->{$column_name} : ''; break; } return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name); }
/** * Email template tag: {donation} * * Output the donation form name, and the donation level (if applicable). * * @param int $payment_id * * @return string $form_title */ function give_email_tag_donation($payment_id) { $payment = new Give_Payment($payment_id); $payment_meta = $payment->payment_meta; $level_title = give_has_variable_prices($payment_meta['form_id']); $separator = $level_title ? '-' : ''; $form_title = strip_tags(give_get_payment_form_title($payment_meta, false, $separator)); return !empty($form_title) ? $form_title : esc_html__('There was an error retrieving the donation form name.', 'give'); }
/** * This template is used to display the purchase summary with [give_receipt] */ global $give_receipt_args, $payment; //Validation: Ensure $payment var is set if (empty($payment) && isset($give_receipt_args['id'])) { $payment = get_post($give_receipt_args['id']); } //Double-Validation: Check for $payment global if (empty($payment)) { give_output_error(esc_html__('The specified receipt ID appears to be invalid', 'give')); return; } $meta = give_get_payment_meta($payment->ID); $donation = give_get_payment_form_title($meta); $user = give_get_payment_meta_user_info($payment->ID); $email = give_get_payment_user_email($payment->ID); $status = give_get_payment_status($payment, true); /** * Fires in the payment receipt shortcode, before the receipt main table. * * Allows you to add elements before the table. * * @since 1.0 * * @param object $payment The payment object. * @param array $give_receipt_args Receipt_argument. */ do_action('give_payment_receipt_before_table', $payment, $give_receipt_args); ?>