FRS Parent Email Lookup

/** * Get Parent Email Shortcode * Usage: [frs-parent-email] * logic: Finds the Group Owner’s email based on the current user’s group. */ function frsGetParentEmail() { // 1. Use the “Universal Brain” to find the Group ID // This handles…Continue reading

FRS Work Order Number Generator

add_action(‘frm_after_create_entry’, ‘autoIDGenerator’, 30, 2); function autoIDGenerator($entry_id, $form_id ) { // Ensure constants are defined to prevent warnings if ( !defined(‘WORK_ORDER_FORM_KEY’) ) return; switch ($form_id) { case FrmForm::get_id_by_key(WORK_ORDER_FORM_KEY): workOrderNumberGenerator($entry_id); break; default: break; } } function workOrderNumberGenerator($entry_id) { // 1. Get the…Continue reading

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