data->user_email) ) { $checkout_email = $current_user->data->user_email; } } // TARGETS $success_html_id = "hg-stripe-donation-success-" . $button_id; $error_html_id = "hg-stripe-donation-error-" . $button_id; // FORM TO USE $layout = isset($atts['layout']) ? $atts['layout'] : "user-amount"; // IF CUSTOM if( $layout != "user-amount" AND $layout != "exact") { $layout_template = locate_template( array( $layout . ".php" ) ); // NO CUSTOM TEMPLATE FOUND if( !$layout_template ) { // IF ADMIN, SHOW A MESSAGE if( current_user_can( 'manage_options' ) ) { echo "" . sprintf(__("A donation template could not be found for %s.php", 'hg-stripe-donate'), $layout) . ""; } else { $layout == "user-amount"; } } } // GET TEMPLATE LOCATION FOR DEFAULT LAYOUTS if( $layout == "user-amount" OR $layout == "exact") { $layout_template = dirname(__FILE__) . "/layouts/" . $layout . ".php"; } // POST TO URL $post_to_url = trailingslashit(get_site_url()); if( !$test_mode ) $post_to_url = str_replace( "http://", "https://" , $post_to_url ); if( isset($atts['ssl']) AND $atts['ssl'] == "off" ) $post_to_url = str_replace( "https://", "http://" , $post_to_url ); // SANITIZE if( $checkout_image == "false" ) $checkout_image = ""; if( $checkout_remember != 'true' AND $checkout_remember != 'false' ) $checkout_remember = 'false'; if( $checkout_zipcode != 'true' AND $checkout_zipcode != 'false' ) $checkout_zipcode = 'false'; $button_label = str_replace("{{amount}}", $prefilled_amount / 100, $button_label); ob_start(); ?>