Disabilita metodi di pagamento se azienda o partita iva

add_filter( ‘woocommerce_checkout_fields’, function( $fields ) { $fields[‘billing’][‘tipologia_cliente’][‘class’][] = ‘update_totals_on_change’; $fields[‘billing’][‘billing_company’][‘class’][] = ‘update_totals_on_change’; $fields[‘billing’][‘billing_piva’][‘class’][] = ‘update_totals_on_change’; return $fields; }, 9999); add_filter( ‘woocommerce_available_payment_gateways’, function($available_gateways) { if ( ! is_admin() && WC()->session ) { $billing_azienda = false; //nikon store ha la tipologia cliente…Continue reading

Nital Legacy User Password Check

add_filter(‘check_password’, function($check, $password, $hash, $user_id) { if ( !$check ) { //se il check standard non è andato a buon fine verifichiamo la password legacy $user_salt = get_user_meta( $user_id, ‘nlup_salt’, true ); if ( $user_salt ) { $check = hash_equals($hash,…Continue reading

WPForms – Create User Smart Tags from the WordPress profile.

/** * Create User Smart Tags from the WordPress profile. * * @link https://wpforms.com/developers/how-to-create-more-user-smart-tags/ */ function wpf_dev_register_user_profile_smart_tags ( $tags ) { // Key is the tag, item is the tag name. $tags[ ‘wp_nickname’ ] = ‘WP Profile Nickname’; $tags[ ‘wp_username’…Continue reading

Move Jump to Recipe above featured image in Genesis (copy)

/** * Ensures the “Jump to Recipe” button is added above the featured image. */ add_action( ‘init’, function(){ if ( method_exists( ‘Tasty_RecipesShortcodes’, ‘filter_the_content_late’ ) ) { remove_filter( ‘the_content’, array( ‘Tasty_RecipesShortcodes’, ‘filter_the_content_late’ ), 100 ); add_action( ‘genesis_before_entry_content’, function() { echo Tasty_RecipesShortcodes::filter_the_content_late(…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