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 | |
| /** | |
| * Output a list of EDD's terms (with links) from the 'download_category' taxonomy | |
| */ | |
| function sumobi_list_edd_terms() { | |
| $taxonomy = 'download_category'; // EDD's taxonomy for categories | |
| $terms = get_terms( $taxonomy ); // get the terms from EDD's download_category taxonomy | |
| ?> | |
| <ul class="download-categories"> | |
| <?php foreach ( $terms as $term ) : ?> |
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 sumobi_edd_social_discounts_share_url( $url ) { | |
| // append to URL | |
| $url .= '?source=social_share'; | |
| return $url; | |
| } | |
| add_filter( 'edd_social_discounts_share_url', 'sumobi_edd_social_discounts_share_url' ); |
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 sumobi_edd_sd_success_message( $message, $product_id ) { | |
| // if there's a $product_id passed in from ajax use that, otherwise set to post ID of page | |
| $product_id = $product_id ? $product_id : get_the_ID(); | |
| // return if the ID is not a 'download' | |
| if ( 'download' != get_post_type( $product_id ) ) | |
| return $message; | |
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 sumobi_social_discounts_purchase_confirmation_url( $url ) { | |
| global $edd_options; | |
| // make sure we are on the EDD Purchase Confirmation page, else return | |
| if ( ! ( isset( $edd_options['success_page'] ) && is_page( $edd_options['success_page'] ) ) ) | |
| return; | |
| // get the purchase session |
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 sumobi_purchase_link_text( $defaults ) { | |
| // add conditionals here | |
| // change text, depending on conditionals | |
| $defaults['text'] = 'The new button text'; | |
| return $defaults; | |
| } |
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_filter_taxonomy( $query ) { | |
| if ( is_admin() || ! $query->is_main_query() ) | |
| return; | |
| if( $query->is_tax( 'download_category' ) ) { | |
| $query->set( 'posts_per_page', 50 ); // change this number |
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 sumobi_custom_show_average_star_rating() { | |
| // make sure edd reviews is active | |
| if ( ! function_exists( 'edd_reviews' ) ) | |
| return; | |
| $edd_reviews = edd_reviews(); | |
| // get the average rating for this download | |
| $average_rating = (int) $edd_reviews->average_rating( false ); |
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 sumobi_edd_order_category_downloads( $query ) { | |
| if ( is_admin() || ! $query->is_main_query() ) | |
| return; | |
| if( $query->is_tax( 'download_category' ) ) { | |
| $query->set( 'orderby', 'title' ); | |
| $query->set( 'order', 'ASC' ); | |
| } |
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 | |
| // remove/unhook the user info fields | |
| remove_action( 'edd_register_fields_before', 'edd_user_info_fields' ); | |
| // add/rehook the user info fields to after the register fields | |
| add_action( 'edd_register_fields_after', 'edd_user_info_fields' ); |
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 sumobi_custom_edd_hide_download_redirect( $url ) { | |
| // download has ID of 17 | |
| if ( '17' == get_the_ID() ) { | |
| $url = 'http://easydigitaldownloads.com'; // redirect user to another external URL | |
| } | |
| // download has ID of 15 | |
| if( '15' == get_the_ID() ) { |