示例#1
0
/**
 * Registration Form
 *
 * @since 2.0
 * @global       $give_options
 * @global       $post
 *
 * @param string $redirect Redirect page URL
 *
 * @return string Register form
 */
function give_register_form($redirect = '')
{
    global $give_options, $give_register_redirect;
    if (empty($redirect)) {
        $redirect = give_get_current_page_url();
    }
    $give_register_redirect = $redirect;
    ob_start();
    if (!is_user_logged_in()) {
        give_get_template_part('shortcode', 'register');
    }
    return apply_filters('give_register_form', ob_get_clean());
}
示例#2
0
/**
 * Profile Editor Shortcode.
 *
 * Outputs the Give Profile Editor to allow users to amend their details from the
 * front-end. This function uses the Give templating system allowing users to
 * override the default profile editor template. The profile editor template is located
 * under templates/profile-editor.php, however, it can be altered by creating a
 * file called profile-editor.php in the give_template directory in your active theme's
 * folder. Please visit the Give Documentation for more information on how the
 * templating system is used.
 *
 * @since  1.0
 *
 * @param array   $atts    attributes
 * @param string  $content
 *
 * @return string Output generated from the profile editor
 */
function give_profile_editor_shortcode($atts, $content = null)
{
    ob_start();
    give_get_template_part('shortcode', 'profile-editor');
    $display = ob_get_clean();
    return $display;
}
示例#3
0
/**
 * PayPal Success Page
 *
 * Shows "Donation Processing" message for PayPal payments that are still pending on site return
 *
 * @since      1.0
 *
 * @param $content
 *
 * @return string
 *
 */
function give_paypal_success_page_content($content)
{
    if (!isset($_GET['payment-id']) && !give_get_purchase_session()) {
        return $content;
    }
    $payment_id = isset($_GET['payment-id']) ? absint($_GET['payment-id']) : false;
    if (!$payment_id) {
        $session = give_get_purchase_session();
        $payment_id = give_get_purchase_id_by_key($session['purchase_key']);
    }
    $payment = get_post($payment_id);
    if ($payment && 'pending' == $payment->post_status) {
        // Payment is still pending so show processing indicator to fix the race condition.
        ob_start();
        give_get_template_part('payment', 'processing');
        $content = ob_get_clean();
    }
    return $content;
}
 /**
  * Output the product title.
  */
 function give_template_single_title()
 {
     give_get_template_part('single-give-form/title');
 }
示例#5
0
 /**
  * Build the final email
  *
  * @since 1.0
  */
 public function build_email($message)
 {
     if (false === $this->html) {
         return apply_filters('give_email_message', wp_strip_all_tags($message), $this);
     }
     $message = $this->text_to_html($message);
     ob_start();
     give_get_template_part('emails/header', $this->get_template(), true);
     do_action('give_email_header', $this);
     if (has_action('give_email_template_' . $this->get_template())) {
         do_action('give_email_template_' . $this->get_template());
     } else {
         give_get_template_part('emails/body', $this->get_template(), true);
     }
     do_action('give_email_body', $this);
     give_get_template_part('emails/footer', $this->get_template(), true);
     do_action('give_email_footer', $this);
     $body = ob_get_clean();
     $message = str_replace('{email}', $message, $body);
     return apply_filters('give_email_message', $message, $this);
 }
示例#6
0
<?php

/**
 * The template for displaying all single Give Donation Forms
 *
 */
get_header();
?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

		<?php 
do_action('give_before_main_content');
// Start the loop.
while (have_posts()) {
    the_post();
    give_get_template_part('single-give-form/content', 'single-give-form');
    // End the loop.
}
do_action('give_after_main_content');
?>

		</main><!-- .site-main -->
	</div><!-- .content-area -->

<?php 
get_footer();
						<?php 
        do_action('my-give-before-archive-form');
        //Output the title
        ?>
						<h2 class="my-give-archive-form-title give-form-title"><a href="<?php 
        echo get_the_permalink();
        ?>
"><?php 
        echo get_the_title();
        ?>
</a></h2>
						<?php 
        $id = get_the_ID();
        //Output the featured image
        give_get_template_part('single-give-form/featured-image');
        //Output the content
        $content_option = get_post_meta($id, '_give_content_option', true);
        if ($content_option != 'none') {
            $content = get_post_meta($id, '_give_form_content', true);
            echo '<div class="my-give-archive-content">' . $content . '</div>';
        }
        //Output the goal
        $goal_option = get_post_meta($id, '_give_goal_option', true);
        if ($goal_option == 'yes') {
            $shortcode = '[give_goal id="' . $id . '"]';
            echo do_shortcode($shortcode);
        }
        //Output a link to take users to the form
        ?>
						<h3 class="my-give-archive-donate-now-link"><a href="<?php