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
| /*-- Smart Coupons By URL Integration --*/ | |
| add_action( 'cartflows_checkout_after_configure_cart', 'cartflows_smart_coupons_apply_coupon_from_url', 10, 1 ); | |
| function cartflows_smart_coupons_apply_coupon_from_url( $checkout_id ) { | |
| $cart = ( is_object( WC() ) && isset( WC()->cart ) ) ? WC()->cart : null; | |
| parse_str( wp_unslash( $_SERVER['QUERY_STRING'] ), $coupon_args ); // phpcs:ignore | |
| $coupon_args = wc_clean( $coupon_args ); | |
| // If Coupons are in 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
| /*-- Member Expiration Date Shortcode -----------------*/ | |
| //[pmpro_expiration_date] | |
| function pmpro_expiration_date_shortcode( $atts ) { | |
| //make sure PMPro is active | |
| if(!function_exists('pmpro_getMembershipLevelForUser')) | |
| return; | |
| //get attributes | |
| $a = shortcode_atts( array( | |
| 'user' => '', |
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
| /*-- Show Content Before Expiration Shortcode -----------------*/ | |
| function pmpro_before_expiration_shortcode( $atts, $content=null, $code="" ) { | |
| //make sure PMPro is active | |
| if(!function_exists('pmpro_getMembershipLevelForUser')) | |
| return; | |
| //get attributes | |
| $a = shortcode_atts( array( | |
| 'user' => '', | |
| 'days' => '15', |
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
| // Shortcode For User Subscription Actions | |
| function cd_wcs_user_action_button( $atts ) { | |
| // Attributes | |
| $atts = shortcode_atts( | |
| array( | |
| 'user' => '', | |
| 'status' => 'active', | |
| 'button' => 'id', | |
| 'title' => '', |
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
| add_shortcode( 'kleo_search_form', 'kleo_search_form_func' ); | |
| function kleo_search_form_func( $atts, $content = null ) { | |
| $form_style = $type = $placeholder = $context = $el_class = ''; | |
| extract( shortcode_atts( array( | |
| 'form_style' => 'default', | |
| 'type' => 'both', | |
| 'context' => '', | |
| 'placeholder' => '', | |
| 'el_class' => '' |
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
| /*-- Disable New Referral Email for PAID Affiliates -----------*/ | |
| function disable_new_refferal_email( $return, $referral ) { | |
| // Check to see if AffiliateWP is active. | |
| if ( ! function_exists( 'affiliate_wp' ) ) { | |
| return; | |
| } | |
| $affiliate_id = $referral->affiliate_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
| /** | |
| * MyBookTable: use book image as post thumbnail | |
| */ | |
| //Find Book Image ID | |
| add_filter( 'get_post_metadata', 'mbt_use_book_image_as_thumbnail', 10, 4 ); | |
| function mbt_use_book_image_as_thumbnail( $null, $object_id, $meta_key, $single ) { | |
| if ( '_thumbnail_id' !== $meta_key ) { | |
| return $null; | |
| } |
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
| // ORDER GRID BY DATE SECOND IF META KEY ORDER IS ENABLED | |
| //add_filter( 'wpupg_get_posts_args', 'wpupg_order_by_date_second', 10, 2); | |
| add_filter( 'wpupg_query_post_args', 'wpupg_order_by_date_second', 10, 2); | |
| function wpupg_order_by_date_second( $args, $page ){ | |
| if( $args['orderby'] == 'meta_value_num' ){ | |
| $args['orderby'] = 'meta_value_num date'; | |
| } | |
| return $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
| //WooCommerce Purchased Total Shortcode | |
| add_shortcode( 'cd-purchased-total', 'cd_shortcode_purchased_totals' ); | |
| function cd_shortcode_purchased_totals( $atts ){ | |
| STATIC $cd_shortcode_count; | |
| $cd_shortcode_count++; | |
| $total_value = 0; | |
| $_atts = shortcode_atts( array( | |
| 'product_ids' => '', |
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 | |
| /** | |
| * Wrapper for MailChimp's API. | |
| * | |
| * @since 1.1.0 | |
| * | |
| * @package ET\Core\API\Email | |
| */ | |
| class ET_Core_API_Email_MailChimp extends ET_Core_API_Email_Provider { |