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 company field to EDD's registration form | |
*/ | |
function my_child_theme_register_account_fields() { ?> | |
<p id="edd-user-company-wrap"> | |
<label for="edd-company"> | |
<?php _e( 'Company', 'my-child-theme' ); ?> |
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 | |
/** | |
* Unhook default EDD discount field | |
*/ | |
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 ); | |
/** | |
* Custom EDD discount field function | |
*/ |
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 | |
/** | |
* Exclude downloads from search | |
*/ | |
function my_child_theme_download_post_type_args( $download_args ) { | |
$download_args['exclude_from_search'] = true; | |
return $download_args; | |
} |
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 my_child_theme_edd_format_amount_decimals( $decimals, $amount ) { | |
$decimals = 0; | |
return $decimals; | |
} | |
add_filter( 'edd_format_amount_decimals', 'my_child_theme_edd_format_amount_decimals', 10, 2 ); |
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 my_child_theme_edd_format_amount_decimals( $decimals, $amount ) { | |
if( floor( $amount ) == $amount ) | |
$decimals = 0; | |
return $decimals; | |
} | |
add_filter( 'edd_format_amount_decimals', 'my_child_theme_edd_format_amount_decimals', 10, 2 ); |
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 | |
/** | |
* Get an array of all the log IDs using the EDD Logging Class | |
* | |
* @return array if logs, null otherwise | |
* @param $download_id Download's ID | |
*/ | |
function get_log_ids( $download_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 | |
function my_child_theme_edd_purchase_form_after_cc_form() { ?> | |
<p>Enter your text here</p> | |
<?php } | |
add_action( 'edd_purchase_form_after_cc_form', 'my_child_theme_edd_purchase_form_after_cc_form' ); |
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 my_child_theme_edd_download_category_args( $category_labels ) { | |
$slug = defined( 'EDD_SLUG' ) ? EDD_SLUG : 'downloads'; | |
// modify the "the-new-category-label" below to your liking | |
$category_labels['rewrite'] = array('slug' => $slug . '/the-new-category-label', 'with_front' => false, 'hierarchical' => true ); | |
return $category_labels; | |
} |
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 my_child_theme_edd_download_supports( $supports ) { | |
$supports[] = 'genesis-cpt-archives-settings'; | |
return $supports; | |
} | |
add_filter( 'edd_download_supports', 'my_child_theme_edd_download_supports' ); |
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 my_child_theme_validate_fields( $required_fields ) { | |
$new_required_fields = array( | |
'billing_country' => array( | |
'error_id' => 'invalid_billing_country', | |
'error_message' => __( 'Please enter your Billing Country', 'edd' ) | |
) |