/** * Snippet: Disable a Payment Gateway for a country */ add_filter( ‘woocommerce_available_payment_gateways’, ‘disable_payment_gateway_based_on_country’, 9999 ); function disable_payment_gateway_based_on_country( $available_gateways ) { if ( is_admin() ) return $available_gateways; if ( isset( $available_gateways[‘stripe’] ) && WC()->customer && WC()->customer->get_billing_country() == ‘IN’ ) {…Continue reading
add_filter( ‘charitable_default_donation_fields’, ‘charitable_filter_countries_donation_form’, 10, 1 ); function charitable_filter_countries_donation_form( $donation_fields = array() ) { if ( empty( $donation_fields[‘country’][‘donation_form’][‘options’] ) ) { return $donation_fields; } $countries_for_donation_form = $donation_fields[‘country’][‘donation_form’][‘options’]; // you can remove a country. unset( $countries_for_donation_form[‘CA’] ); // ..or you can create…Continue reading
add_filter( ‘login_head’, function () { // Update the line below with the URL to your own logo. // Adjust the Width & Height accordingly. $custom_logo = ‘https://www.benefitscore.org/wp-content/uploads/2024/10/512×512-file-favi.svg’; $logo_width = 84; $logo_height = 84; printf( ‘ ‘, $custom_logo, $logo_width, $logo_height );…Continue reading
/** * Purpose: This code dynamically adds an FAQ repeater field to two different forms (Form IDs 3 and 5) * within Gravity Forms. It allows for the creation of a set of “Frequently Asked Questions” fields * (question and…Continue reading
/** * This code adds a video repeater field to specific Gravity Forms (IDs 3 and 5), pre-populates it with data from * ACF fields related to vendors or venues, and saves the submitted video gallery data back to the…Continue reading
/** * This code adds a video repeater field to specific Gravity Forms (IDs 3 and 10), pre-populates it with data from * ACF fields related to vendors or venues, and saves the submitted video gallery data back to the…Continue reading
/** * This code adds a video repeater field to specific Gravity Forms (IDs 3 and 10), pre-populates it with data from * ACF fields related to vendors or venues, and saves the submitted video gallery data back to the…Continue reading
/** * * Retrieve post ID by user ID and post type (either ‘vendor’ or ‘venue’). * * @param int $user_id The current user’s ID. * @param string $post_type The post type to search for (‘vendor’ or ‘venue’). * @return…Continue reading
/** * * Retrieve post ID by user ID and post type (either ‘vendor’ or ‘venue’). * * @param int $user_id The current user’s ID. * @param string $post_type The post type to search for (‘vendor’ or ‘venue’). * @return…Continue reading
/** * Conditionally show the submit button * * @link https://wpforms.com/developers/how-to-conditionally-show-the-submit-button/ */ add_action( ‘wp_head’, function () { ?>Continue reading