Replace Add to Cart With Download for Subscribers (copy)

add_filter( ‘edd_purchase_download_form’, ‘ck_edd_user_download_button_recurring’, 10, 2 ); function ck_edd_user_download_button_recurring( $purchase_form, $args ) { if( ! class_exists( ‘EDD_Recurring_Customer’ ) ) return $purchase_form; if( ! EDD_Recurring_Customer::is_customer_active( get_current_user_id() ) ) return $purchase_form; if ( !is_user_logged_in() ) return $purchase_form; $download_id = (string)$args[‘download_id’]; $current_user_id = get_current_user_id();…Continue reading

Replace Add to Cart With Download for Subscribers (copy)

add_filter( ‘edd_purchase_download_form’, ‘ck_edd_user_download_button_recurring’, 10, 2 ); function ck_edd_user_download_button_recurring( $purchase_form, $args ) { if( ! class_exists( ‘EDD_Recurring_Customer’ ) ) return $purchase_form; if( ! EDD_Recurring_Customer::is_customer_active( get_current_user_id() ) ) return $purchase_form; if ( !is_user_logged_in() ) return $purchase_form; $download_id = (string)$args[‘download_id’]; $current_user_id = get_current_user_id();…Continue reading

Replace Add to Cart With Download for Subscribers (copy)

add_filter( ‘edd_purchase_download_form’, ‘ck_edd_user_download_button_recurring’, 10, 2 ); function ck_edd_user_download_button_recurring( $purchase_form, $args ) { if( ! class_exists( ‘EDD_Recurring_Customer’ ) ) return $purchase_form; if( ! EDD_Recurring_Customer::is_customer_active( get_current_user_id() ) ) return $purchase_form; if ( !is_user_logged_in() ) return $purchase_form; $download_id = (string)$args[‘download_id’]; $current_user_id = get_current_user_id();…Continue reading

Shortcode for Comma-Separated List Parsing and Grouping

function formidable_shortcode_list_view($atts) { global $wpdb; // Shortcode attributes $atts = shortcode_atts(array( ‘field_id’ => ”, ), $atts, ‘formidable_list_view’); if (empty($atts[‘field_id’])) { return ‘Field ID is required.’; } // Get all entries $entries = $wpdb->get_results( $wpdb->prepare( “SELECT meta_value FROM {$wpdb->prefix}frm_item_metas WHERE field_id…Continue reading

DJi – CusRev checkout checkato di default e nascosto

add_filter(‘cr_consent_checkbox’, function($output) { $output = str_replace(‘class=”cr-customer-consent”‘, ‘class=”cr-customer-consent” style=”display:none;”‘, $output); $output = str_replace(‘id=”cr_customer_consent”‘, ‘id=”cr_customer_consent” checked=”checked”‘, $output); return $output; });Continue reading

Add the Page Slug to Body Class (copy)

function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’, ‘wpcode_snippet_add_slug_body_class’ );Continue reading