Back this Project button settings

I'm trying to see if there is a setting or some html code modification so that when a donor decides to contribute, enters an amount to give, presses the Back this Project button - the PayPal interface opens in a new tab versus the apparent current default of a page change on the same tab.

  • Vinod Dalvi

    Hi Thomas,

    Welcome to the WPMU Dev community and thank you for your question.

    You can achieve this by adding the following code in the functions.php file of your child theme or add it in your site using the following plugin.

    http://wordpress.org/plugins/code-snippets/
    http://wordpress.org/plugins/add-actions-and-filters/

    function wdf_checkout_page( $echo = true, $post_id = '' ) {
    		global $wdf, $post; $content = '';
    		$post_id = (empty($post_id) ? $post->ID : $post_id );
    		if(!get_post($post_id))
    			return false;
    
    		if( wdf_time_left(false, $post_id, true) === true ) {
    			$content = '<div class="wdf_no_pledge_start"><h3>'.sprintf(__('This %s is not accepting %s yet.','wdf'), esc_attr($settings['funder_labels']['singular_name']), esc_attr($settings['donation_labels']['plural_name'])).'  '. wdf_time_left(false, $post_id).'</h3></div>';
    			if($echo) {echo $content;} else {return $content;}
    		}
    
    		$meta = get_post_custom($post_id);
    		$settings = get_option('wdf_settings');
    
    		$wdf->front_scripts($post_id);
    		$content = '';
    		global $wdf_checkout_from_panel;
    		$style = ($wdf_checkout_from_panel == true ? '' : wdf_get_style($post_id) );
    
    		$content .= '<form class="wdf_checkout_form '.$style.'" action="'.wdf_get_funder_page('checkout',$post_id).'" method="post" target="_blank">';
    				global $wp_filter;
    				$raised = $wdf->get_amount_raised($post_id);
    				//$goal = $meta['wdf_goal_amount'][0];
    
    				$content .= '<div class="wdf_rewards">';
    				$content .= apply_filters('wdf_error_payment_submit','');
    
    				$content .= '
    				<div class="wdf_payment_options">
    					<div class="wdf_donate_button">'.wdf_pledge_button(false, 'single', $post_id).'</div>
    					<div class="wdf_gateway_choices">'.wdf_gateway_choices(false, (isset($settings['default_gateway']) ? $settings['default_gateway'] : '')).'</div>
    				</div>';
    
    				if(wdf_has_rewards($post_id) && isset($meta['wdf_levels'][0])) {
    					$content .= apply_filters('wdf_before_rewards_title','');
    						$level = maybe_unserialize($meta['wdf_levels'][0]);
    						foreach($level as $index => $data) {
    							$disabled_class = $disabled_input = '';
    							if(isset($data['limit']) && is_numeric($data['limit'])) {
    								$reward_left = $data['limit'] - (isset($data['used']) ? $data['used'] : 0);
    								if($reward_left)
    									$limit_text = ' <span class="wdf_reward_limit">'.__('Limited','wdf').' ('.$reward_left.__(' left of ','wdf').$data['limit'].')'.'</span>';
    
    								else {
    									$limit_text = ' <span class="wdf_reward_limit wdf_reward_limit_gone">'.__('All gone.','wdf').'</span>';
    									$disabled_class = ' wdf_reward_item_disabled';
    									$disabled_input = ' disabled';
    								}
    							}
    							else
    								$limit_text = '';
    
    							$content .= '
    							<div class="wdf_reward_item'.$disabled_class.'">
    								<div class="wdf_reward_choice"><input type="radio" name="wdf_reward" value="'.$index.'" '.$disabled_input.'/><span class="wdf_level_amount" rel="'.$data['amount'].'"> '.$wdf->format_currency('',$data['amount']).$limit_text.'</span></div>
    								<div class="wdf_reward_description">'.html_entity_decode($data['description']).'</div>
    							</div>';
    						}
    						$content .= '
    						<div class="wdf_reward_item wdf_reward_item_none">
    							<div class="wdf_reward_choice"><input type="radio" name="wdf_reward" value="none" /><span class="wdf_level_amount"> '.apply_filters('wdf_no_reward_description',__('None','wdf')).'</span></div>
    						</div>';
    				}
    				$content .= '</div>';
    			$content .= '</form>';
    
    		if($echo) {echo $content;} else {return $content;}
    	}

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.