Display Only Selected Countries on the Vendor Registration Form

add_action( ‘wp_enqueue_scripts’, static function () { $registration_page_id = (int) get_option( ‘wcv_signup_registration_page_id’, 0 ); if ( 0 === $registration_page_id || ! is_page( $registration_page_id ) ) { return; } $allowed_countries = array( ‘AU’, ‘GB’, ‘US’, ‘CA’ ); // ISO 3166-1 alpha-2 codes…Continue reading

mobile redirect (chatgpt)

// Mobile redirect (admin INCLUDED, cache-friendly) add_action(‘template_redirect’, ‘rd_mobile_redirect’, 10); function rd_mobile_redirect() { // Skip only AJAX/cron/preview/REST to avoid breaking editors & API if (wp_doing_ajax() || wp_doing_cron() || is_preview() || defined(‘REST_REQUEST’)) return; $req_uri = $_SERVER[‘REQUEST_URI’] ?? ‘/’; $path = strtok($req_uri, ‘?’);…Continue reading

“Correct” date format on edit

/** * Name: fw_correctBirthdayDateFormat (“fw” indicates “FreeWheelers”) * Desc: For some reason, not currently known, Formidable is displaying dates as YYYY-MM-DD in the date field, when a member is edited * Note: This shouldn’t have to be done **/ add_filter(‘frm_setup_edit_fields_vars’,…Continue reading

Update WP User When Account Username is Changed

/** * Name: fw_updateUserName (“fw” indicates “FreeWheelers”) * Desc: Manually updates the WP username if the user changes her account username **/ add_action(‘frm_after_update_entry’, ‘fw_updateUserName’, 10, 2); function fw_updateUserName( $entry_id, $form_id ) { if ($form_id == MEMBER_REGISTRATION_FORM_ID) { // get the…Continue reading

A/B Test Visibility Check

add_action(‘wp_footer’, function() { // Use this WordPress conditional to ensure the script only loads on the homepage. if ( is_front_page() || is_home() ) { ?>Continue reading