Sprout Venture sproutventure

View gist:1435603
1 2 3 4 5 6 7
add_action('on_biz_voucher_page','require_login_on_voucher_claim');
function require_login_on_voucher_claim() {
if ( !gb_account_has_merchant() ) {
wp_redirect(gb_get_account_login_url());
exit();
}
}
View php_helpers.php
1 2 3 4 5 6 7 8 9 10
<?php
function pp() {
$msg = __v_build_message(func_get_args());
echo '<pre style="white-space:pre-wrap; text-align: left; '.
'font: normal normal 11px/1.4 menlo, monaco, monospaced; '.
'background: white; color: black; padding: 5px;">'.$msg.'</pre>';
}
function dp() {
$msg = __v_build_message(func_get_args(), 'var_dump');
echo '<pre style="white-space:pre-wrap;; text-align: left; '.
View gist:1126637
1 2 3 4 5 6 7 8 9 10
<?php
 
function filter_term_archive( $query ) {
if( is_tax( some_custom_post_type_tax_slug() ) ) {
$query->set( 'tax_query', array(
'relation' => 'AND', // Change to OR if we only want to filter one type.
array(
'taxonomy' => some_custom_tax_slug(),
'field' => 'slug',
'terms' => $array_of_terms
View gist:1032689
1 2 3 4 5 6 7 8 9 10
<?php
 
add_filter( 'purchase_record_array', 'affiliate_post');
function affiliate_post( $record_array ) {
 
// Config
$post_url = "http://www.youdeal.co.za/wp-content/plugins/wp-affiliate-platform/api/post.php";
$key = "ijweol383h538t34t9j";
 
if ( isset($_COOKIE['ap_id'])) {
View gist:980988
1 2 3 4 5 6 7 8 9 10
<?php
 
#******************************************************************************
#* Name : PxPay_Curl.inc.php
#* Description : Classes used interact with the PxPay interface using PHP with the cURL extension installed
#* Copyright : Direct Payment Solutions 2009(c)
#* Date : 2009-04-10
#* Version : 1.0
#* Author : Thomas Treadwell
#******************************************************************************
View GBS latest deal redirect
1 2 3 4 5 6 7 8 9 10
function gb_list_locations_custom( $format = 'ul' )
{
global $gb;
// Form an array of all the locations ( the location term is called 'deals' )
$locations = get_terms(array('deals'),array('hide_empty'=>true,'fields'=>'all'));
// Build out the ul of locations
if ( !empty( $locations) && $format == 'ul' ) {
echo "<ul class='locations-ul clearfix'>";
foreach ($locations as $location) {
$args=array(
View Basic GBS loop
1 2 3 4 5 6 7 8 9 10
<?php
global $wp_query;
$add_deal_query= null;
$args=array(
'post_type' => 'deal',
'post_status' => 'publish',
'meta_key' => $gb->_metaDealExpiration, // Make sure the deal is not exprired
'posts_per_page' => 3, // return this many
'post__not_in' => array( $wp_query->post->ID ) // do not show the current deal within this loop
);
View Unhook GBS form element in child theme
1 2 3 4 5 6 7 8 9 10
/**
* Unhook regsitration_form_addons from parent theme on init. Hooking to init because register_form has already been hooked-in
*
* @author Dan Cameron
*/
add_action('init', 'unhook_registration_form_addons');
function unhook_registration_form_addons()
{
remove_action( 'register_form', 'registration_form_addons' );
}
View WP Affiliate Example
1 2 3 4 5 6 7 8 9
if ( isset($_GET['payment-success']) && ($_GET['payment-success'] != '0' || $_GET['payment-success'] != null) ) {
$userID = Group_Buying_Utility::getCurrentUserId();
?>
<iframe src="http://www.example.com/wp-content/plugins/wp-affiliate-platform/api/post.php?secret=XXXXXXX&trans_id=<?php echo $_GET['trnId'] ?>&ap_id=XXXXXXXX&sale_amt=<?php echo get_deal_value_in_credits( $_GET['item-id'] ); ?>&item_id=<?php echo $_GET['item-id'] ?>" scrolling="no" frameborder="0" width="1" height="1"></iframe>
<?php
}
if ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] ) {
$userID = Group_Buying_Utility::getCurrentUserId();
?>
View gist:799639
1 2 3 4 5 6 7 8 9 10
add_filter('getStates','new_states');
function new_states()
{
return array(
'' => 'Select',
'AL' => 'Alabama',
'AK' => 'Alaska',
'AS' => 'American Samoa',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
Something went wrong with that request. Please try again.