This file contains 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 pw_edd_recurring_payment_received_notice( $payment, $parent_id, $amount, $txn_id, $unique_key ) { | |
$user_id = edd_get_payment_user_id( $parent_id ); | |
$email = edd_get_payment_user_email( $parent_id ); | |
$user_data = get_userdata( $user_id ); | |
$subject = 'Payment Received'; | |
$message = "Hello $usera_data->display_name, your payment for $amount has been received. Thanks!"; |
This file contains 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 pw_edd_send_email_on_pending( $payment_id, $payment_data ) { | |
// grab the gateway so we can only send on email for specific gateways | |
$gateway = isset( $_POST['edd-gateway'] ) ? $_POST['edd-gateway'] : ''; | |
// TODO: replace "bacs" with your gateway ID | |
if( $gateway != 'bacs' ) | |
return; |
This file contains 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 pw_rcp_earnings_slash_command() { | |
# Check to make sure this is a Slash Command Request | |
if ( ! isset( $_REQUEST['slack_slash'] ) && 'your_custom_string' != $_REQUEST['slack_slash'] ) | |
return false; | |
# Check to see if a token has been passed as well | |
if ( ! isset( $_REQUEST['token'] ) ) |
This file contains 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 get_header(); ?> | |
<div id="main-content" class="row store-template"> | |
<div class="content clearfix"> | |
<?php | |
$current_page = get_query_var('paged'); | |
$per_page = get_option('posts_per_page'); | |
$offset = $current_page > 0 ? $per_page * ($current_page-1) : 0; | |
$product_args = array( | |
'post_type' => 'download', |
This file contains 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 | |
/** | |
* Plugin Name: EDD Heartbeat API test plugin | |
* Description: Demonstrates how to use the Heartbeat API to update the payments count on the dashboard | |
*/ | |
// Load the heartbeat JS | |
function edd_heartbeat_enqueue( $hook_suffix ) { | |
// Make sure the JS part of the Heartbeat API is loaded. | |
wp_enqueue_script( 'heartbeat' ); |
This file contains 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 get_the_user_ip() { | |
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { | |
//check ip from share internet | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
//to check ip is pass from proxy | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; |
This file contains 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 | |
$commissions = get_posts( array( | |
'post_type' => 'edd_commission', | |
'posts_per_page' => -1, | |
'fields' => 'ids', | |
'date_query' => array( | |
'after' => array( | |
'year' => 2015, | |
'month' => 03, | |
'day' => 15 |
This file contains 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 custom_prefix_warn_about_old_refunds_js() { | |
if ( ! isset( $_GET['prevent_accidental_refunds_js'] ) ) { | |
return false; | |
} | |
header('Content-Type: application/javascript'); | |
?> |
This file contains 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
<a href="<?php echo add_query_arg( array( 'edd_action' => 'add_to_cart', 'download_id' => get_the_ID() ), edd_get_checkout_uri() ); ?>">Add to Cart</a> |
This file contains 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 pw_edd_purchase_form_required_fields( $required_fields ) { | |
unset( $required_fields['edd_first'] ); | |
return $required_fields; | |
} | |
add_filter( 'edd_purchase_form_required_fields', 'pw_edd_purchase_form_required_fields' ); |