/**
  * Display whether the campaign achieved its goal. 
  *
  * @return  string
  * @access  public
  * @since   1.1.0
  */
 public function get_campaign_achieved_goal($value, $field, $args)
 {
     if (!$this->has_valid_campaign()) {
         return '';
     }
     if (!$this->campaign->has_goal()) {
         return '';
     }
     $defaults = array('success' => __('The campaign achieved its fundraising goal.', 'charitable'), 'failure' => __('The campaign did not reach its fundraising goal.', 'charitable'));
     $args = wp_parse_args($args, $defaults);
     if ($this->campaign->has_achieved_goal()) {
         return $args['success'];
     }
     return $args['failure'];
 }
 /**
  * Display the percentage that the campaign has raised in summary block.
  *
  * @param   Charitable_Campaign $campaign
  * @return  boolean     True if the template was displayed. False otherwise.
  * @since   1.0.0
  */
 function charitable_template_campaign_percentage_raised($campaign)
 {
     if (!$campaign->has_goal()) {
         return false;
     }
     charitable_template('campaign/summary-percentage-raised.php', array('campaign' => $campaign));
     return true;
 }
Beispiel #3
0
 /**
  * Display the campaign progress barometer.
  *
  * @uses 	charitable_template
  *
  * @param   Charitable_Campaign $campaign
  * @return  void
  * @since   1.0.0
  */
 function reach_template_campaign_progress_barometer(Charitable_Campaign $campaign)
 {
     if ($campaign->has_goal()) {
         charitable_template('campaign/progress-barometer.php', array('campaign' => $campaign));
     }
 }