Skip to content

Instantly share code, notes, and snippets.

@ericnicolaas
Created June 17, 2022 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericnicolaas/d7debbbb67eef8df83d36a45a1abc581 to your computer and use it in GitHub Desktop.
Save ericnicolaas/d7debbbb67eef8df83d36a45a1abc581 to your computer and use it in GitHub Desktop.
Giving Hand fixed donation form
<?php
/**
* The template used to display the default form.
*
* @author Studio 164a
* @package Charitable/Templates/Donation Form
* @since 1.0.0
* @version 1.3.0
*/
if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
$form = $view_args['form'];
$user = wp_get_current_user();
$use_ajax = 'make_donation' == $form->get_form_action() && (int) Charitable_Gateways::get_instance()->gateways_support_ajax();
$form_id = isset( $view_args['form_id'] ) ? $view_args['form_id'] : charitable_get_donation_form_id();
if ( ! $form ) {
return;
}
?>
<form method="post" id="<?php echo esc_attr( $form_id ) ?>" class="charitable-donation-form charitable-form" data-use-ajax="<?php echo esc_attr( $use_ajax ) ?>">
<?php
/**
* @hook charitable_form_before_fields
*/
do_action( 'charitable_form_before_fields', $form ) ?>
<div class="tpath-charitable-form-wrapper">
<div class="charitable-form-fields cf">
<?php $form->view()->render(); ?>
</div><!-- .charitable-form-fields -->
<?php
/**
* @hook charitable_form_after_fields
*/
do_action( 'charitable_form_after_fields', $form );
?>
<div class="charitable-form-field charitable-submit-field">
<button class="button button-primary" type="submit" name="donate"><?php esc_attr_e( 'Donate', 'givinghand' ) ?></button>
<div class="charitable-form-processing" style="display: none;">
<img src="<?php echo charitable()->get_path( 'assets', false ) ?>/images/charitable-loading.gif" width="60" height="60" alt="<?php esc_attr_e( 'Loading&hellip;', 'givinghand' ) ?>" />
</div>
</div>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment