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 | |
// Redirect to the post/page itself after publishing or updating a post in | |
// WordPress. This code is from the WordPress forum [1], modified so it doesn't | |
// redirect when saving a draft. | |
// [1]: http://wordpress.org/support/topic/redirect-to-new-post-after-publish | |
add_filter('redirect_post_location', function($location) |
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
// Avg downloads per customer | |
function sc_edd_avg_downloads_per_customer( $atts ) { | |
$amount = 0; | |
$query = new WP_Query( array( 'post_type' => 'download' ) ); | |
foreach( $query->posts as $post ) { | |
$amount = $amount + edd_get_download_sales_stats( $post->ID ); | |
} | |
$amount = $amount / edd_count_total_customers(); | |
return number_format( $amount, 2 ); | |
} |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 1.
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
ID,Type,SKU,Name,Published,"Is featured?","Visibility in catalog","Short description",Description,"Date sale price starts","Date sale price ends","Tax status","Tax class","In stock?",Stock,"Backorders allowed?","Sold individually?","Weight (lbs)","Length (in)","Width (in)","Height (in)","Allow customer reviews?","Purchase note","Sale price","Regular price",Categories,Tags,"Shipping class",Images,"Download limit","Download expiry days",Parent,"Grouped products",Upsells,Cross-sells,"External URL","Button text",Position,"Meta: lw_wc_thank_you_redirect","Meta: ocean_sidebar","Meta: ocean_second_sidebar","Meta: ocean_disable_margins","Meta: ocean_display_top_bar","Meta: ocean_display_header","Meta: ocean_center_header_left_menu","Meta: ocean_custom_header_template","Meta: ocean_header_custom_menu","Meta: ocean_disable_title","Meta: ocean_disable_heading","Meta: ocean_disable_breadcrumbs","Meta: ocean_display_footer_widgets","Meta: ocean_display_footer_bottom","Meta: ocean_link_format_target","Meta: ocean_quote_for |
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 | |
ini_set( 'max_execution_time', 0 ); /* Do not abort with timeouts */ | |
ini_set( 'display_errors', 'Off' ); /* Do not display any errors to anyone */ | |
$urls = array(); /* The broadcast session queue */ | |
/* List of IPN listener points */ | |
$ipns = array( | |
'edd' => 'https://creativeg.gr/?edd-listener=IPN', | |
'edd_payments' => 'https://creativeg.gr/?Paypal_For_Edd=&action=ipn_handler', |
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
/** | |
* Suppliment shortcode to validate item in the cart and print details | |
*/ | |
function cart_content_shortcode( $atts,$cart_key, $item, $ajax = false ) { | |
global $post; | |
$cart_contents = edd_get_cart_contents(); | |
if ( ! empty( $cart_contents ) ) { |
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
/** | |
* Un check all other options on a multiselect pricing, and leave only the last selected | |
*/ | |
function sumobi_edd_deselect_other_price_options() { | |
if ( ! edd_has_variable_prices( get_the_ID() ) ) | |
return; | |
?> | |
<script> | |
jQuery(document).ready(function ($) { |
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
/** | |
* Modify the purchase link for downloads that are free and have only 1 download file to allow direct download bypassing checkout. | |
*/ | |
add_filter( 'edd_purchase_download_form', 'isa_edd_purchase_form', 20, 2 ); | |
function isa_edd_purchase_form( $purchase_form, $args ) { | |
$download_id = absint( $args['download_id'] ); | |
if ( $download_id ) { |
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
/** | |
* Easy Digital Downloads - Add the customer's username to the payment's "Customer Details" section and link through to their profile | |
*/ | |
function sumobi_edd_customer_details_username( $payment_id ) { | |
$user_info = edd_get_payment_meta_user_info( $payment_id ); | |
$customer_id = $user_info['id']; | |
if ( ! $customer_id ) { | |
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
function cg_add_handling_fee() | |
{ | |
$current_user = wp_get_current_user(); | |
if ($current_user !=0) { | |
$userId = $current_user->ID; | |
$subscriber = new EDD_Recurring_Subscriber($userId, true); | |
$subscription = new EDD_Subscription($userId); //subscriber id | |
//expiration date check | |
$expiration_date = $subscription->get_expiration(); | |
if (strtotime($expiration_date) > strtotime('-5 day')) { |
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
/** | |
* Easy Digital Downloads | |
* Change the button text of a free download. Default is "Free - Add to Cart" | |
*/ | |
function cg_edd_free_download_text_args( $args ) { | |
// Enter the button text for a free download | |
$download_id = absint( $args['download_id'] ); | |
if ( 4915 == $download_id ) { | |
$args['text'] = 'Start Here'; | |
} else { |
NewerOlder