This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; '. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
#****************************************************************************** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('getStates','new_states'); | |
function new_states() | |
{ | |
return array( | |
'' => 'Select', | |
'AL' => 'Alabama', | |
'AK' => 'Alaska', | |
'AS' => 'American Samoa', | |
'AZ' => 'Arizona', | |
'AR' => 'Arkansas', |
NewerOlder