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: Easy Digital Downloads - Sort category archives by random order | |
*/ | |
function jp_sort_edd_category_archives( $query ) { | |
if ( is_tax( 'download_category' ) && $query->is_main_query() ) { | |
$query->set( 'orderby', 'rand' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'jp_sort_edd_category_archives' ); |
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 jp_no_krw_decimal( $decimals, $currency ) { | |
if ( 'KRW' == $currency ) { // Korean Won. Set to your currency code. | |
return 0; | |
} | |
return $decimals; | |
} | |
add_filter( 'edd_currency_decimal_count', 'jp_no_krw_decimal', 10, 2 ); |
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
INITIALISATION | |
============== | |
load wp-config.php | |
set up default constants | |
load wp-content/advanced-cache.php if it exists | |
load wp-content/db.php if it exists | |
connect to mysql, select db | |
load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
load wp-content/sunrise.php if it exists (multisite only) |
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 | |
// Sets the post format to audio on product submissions made in Frontend Submissions. | |
function jp_set_audio_post_format( $post_id ) { | |
set_post_format( $post_id, 'audio' ); | |
} | |
add_action( 'fes_submit_submission_form_bottom', 'jp_set_audio_post_format' ); |
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 jp_no_email_free( $payment_id ) { | |
$amount = edd_get_payment_amount( $payment_id ); | |
if ( 0 == $amount ) { | |
remove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 1 ); // This disables customer purchase receipts | |
remove_action( 'edd_admin_sale_notice', 'edd_admin_email_notice', 10, 2 ); // This disables email notices to admins | |
} | |
} | |
add_action( 'edd_complete_purchase', 'jp_no_email_free', 998, 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
<?php | |
/** | |
* Plugin Name: Digital Store - Add content to storefront template. | |
*/ | |
function jp_inject_the_content() { | |
remove_action( 'digitalstore_store_front', 'digitalstore_front_latest_downloads', 2 ); | |
add_action( 'digitalstore_store_front', 'digitalstore_front_latest_downloads', 3 ); | |
add_action( 'digitalstore_store_front', 'jp_add_content', 2 ); | |
} | |
add_action( 'init', 'jp_inject_the_content' ); |
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
/** | |
* Removes the billing details section on the checkout screen. | |
*/ | |
function jp_disable_billing_details() { | |
remove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields' ); | |
} | |
add_action( 'init', 'jp_disable_billing_details' ); |
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 $target = ( edd_is_checkout() ) ? ' target="_blank"' : ''; ?> | |
<h3 itemprop="name" class="edd_download_title"> | |
<a title="<?php the_title_attribute(); ?>" itemprop="url" href="<?php the_permalink(); ?>" <?php echo $target; ?>><?php the_title(); ?></a> | |
</h3> |