get_user_meta($user_id, 'personal_accreditation', true), 'business_name' => get_user_meta($user_id, 'business_name', true), 'business_phone' => get_user_meta($user_id, 'business_phone', true), 'business_email' => get_user_meta($user_id, 'business_email', true), 'business_website' => get_user_meta($user_id, 'business_website', true), 'business_description' => get_user_meta($user_id, 'business_description', true), 'user_country' => get_user_meta($user_id, 'user_country', true), 'user_state' => get_user_meta($user_id, 'user_state', true), 'user_city' => get_user_meta($user_id, 'user_city', true), 'user_zip' => get_user_meta($user_id, 'user_zip', true), 'user_linkedin' => get_user_meta($user_id, 'user_linkedin', true), 'business_type' => get_user_meta($user_id, 'business_type', true), 'training_audience' => get_user_meta($user_id, 'training_audience', true), 'training_formats' => get_user_meta($user_id, 'training_formats', true), 'training_locations' => get_user_meta($user_id, 'training_locations', true), 'training_resources' => get_user_meta($user_id, 'training_resources', true), 'annual_revenue_target' => get_user_meta($user_id, 'annual_revenue_target', true), ); // Get profile image $profile_image_id = get_user_meta($user_id, 'profile_image_id', true); $profile_image_url = ''; if ($profile_image_id) { $profile_image_url = wp_get_attachment_url($profile_image_id); } // Get messages (success, error) from query parameters if present $message = ''; $message_type = ''; if (isset($_GET['updated']) && $_GET['updated'] === '1') { $message = 'Your profile has been updated successfully.'; $message_type = 'success'; } elseif (isset($_GET['updated']) && $_GET['updated'] === '0') { $message = 'There was an error updating your profile. Please try again.'; $message_type = 'error'; } // Check if we have form errors from a previous submission via transient $errors = []; $transient_key = null; if (isset($_GET['prof_error']) && $_GET['prof_error'] === '1' && isset($_GET['tid'])) { $transient_key = 'hvac_prof_' . sanitize_key($_GET['tid']); $transient_data = get_transient($transient_key); if ($transient_data && is_array($transient_data)) { $errors = $transient_data['errors'] ?? []; // Delete the transient immediately after retrieving delete_transient($transient_key); } } // Define country, state, and province options function get_us_states() { return array( 'AL' => 'Alabama', 'AK' => 'Alaska', 'AZ' => 'Arizona', 'AR' => 'Arkansas', 'CA' => 'California', 'CO' => 'Colorado', 'CT' => 'Connecticut', 'DE' => 'Delaware', 'DC' => 'District of Columbia', 'FL' => 'Florida', 'GA' => 'Georgia', 'HI' => 'Hawaii', 'ID' => 'Idaho', 'IL' => 'Illinois', 'IN' => 'Indiana', 'IA' => 'Iowa', 'KS' => 'Kansas', 'KY' => 'Kentucky', 'LA' => 'Louisiana', 'ME' => 'Maine', 'MD' => 'Maryland', 'MA' => 'Massachusetts', 'MI' => 'Michigan', 'MN' => 'Minnesota', 'MS' => 'Mississippi', 'MO' => 'Missouri', 'MT' => 'Montana', 'NE' => 'Nebraska', 'NV' => 'Nevada', 'NH' => 'New Hampshire', 'NJ' => 'New Jersey', 'NM' => 'New Mexico', 'NY' => 'New York', 'NC' => 'North Carolina', 'ND' => 'North Dakota', 'OH' => 'Ohio', 'OK' => 'Oklahoma', 'OR' => 'Oregon', 'PA' => 'Pennsylvania', 'RI' => 'Rhode Island', 'SC' => 'South Carolina', 'SD' => 'South Dakota', 'TN' => 'Tennessee', 'TX' => 'Texas', 'UT' => 'Utah', 'VT' => 'Vermont', 'VA' => 'Virginia', 'WA' => 'Washington', 'WV' => 'West Virginia', 'WI' => 'Wisconsin', 'WY' => 'Wyoming' ); } function get_canadian_provinces() { return array( 'AB' => 'Alberta', 'BC' => 'British Columbia', 'MB' => 'Manitoba', 'NB' => 'New Brunswick', 'NL' => 'Newfoundland and Labrador', 'NS' => 'Nova Scotia', 'ON' => 'Ontario', 'PE' => 'Prince Edward Island', 'QC' => 'Quebec', 'SK' => 'Saskatchewan', 'NT' => 'Northwest Territories', 'NU' => 'Nunavut', 'YT' => 'Yukon' ); } function get_country_list() { return array( 'US' => 'United States', 'CA' => 'Canada', 'GB' => 'United Kingdom', 'AU' => 'Australia', 'NZ' => 'New Zealand', 'DE' => 'Germany', 'FR' => 'France', 'IT' => 'Italy', 'ES' => 'Spain', 'JP' => 'Japan', 'CN' => 'China', 'IN' => 'India', 'BR' => 'Brazil', 'MX' => 'Mexico', // Add more countries as needed ); } // --- Template Start --- get_header(); // Use theme's header ?>

Edit Trainer Profile

Personal Information

' . esc_html($errors['first_name']) . '

'; ?>
' . esc_html($errors['last_name']) . '

'; ?>
This will be the name displayed to other users on the site. ' . esc_html($errors['display_name']) . '

'; ?>
' . esc_html($errors['user_email']) . '

'; ?>
' . esc_html($errors['user_url']) . '

'; ?>
' . esc_html($errors['user_linkedin']) . '

'; ?>
Enter your abbreviated accreditations separated by commas.
A short bio about yourself. This will be displayed on your profile page. ' . esc_html($errors['description']) . '

'; ?>
<?php echo esc_attr($user->display_name); ?>
first_name, 0, 1) . substr($user->last_name, 0, 1)); ?>
To update your profile image, select a new .jpg, .png, or .gif file. Leave empty to keep your current image. ' . esc_html($errors['profile_image']) . '

'; ?>

Business Information

' . esc_html($errors['business_name']) . '

'; ?>
' . esc_html($errors['business_phone']) . '

'; ?>
' . esc_html($errors['business_email']) . '

'; ?>
' . esc_html($errors['business_website']) . '

'; ?>
' . esc_html($errors['business_description']) . '

'; ?>

Address Information

' . esc_html($errors['user_country']) . '

'; ?>
' . esc_html($errors['user_state']) . '

'; ?> ' . esc_html($errors['user_state_other']) . '

'; ?>
' . esc_html($errors['user_city']) . '

'; ?>
' . esc_html($errors['user_zip']) . '

'; ?>

Training Information

What type of business are you?
'business_type', 'hide_empty' => false]); if (!is_wp_error($business_terms) && !empty($business_terms)) { foreach ($business_terms as $term) { echo ''; } } else { // Fallback to hardcoded options if taxonomy not available $business_types = ["Manufacturer", "Distributor", "Contractor", "Consultant", "Educator", "Government", "Other"]; foreach ($business_types as $type) { echo ''; } } ?>
' . esc_html($errors['business_type']) . '

'; ?>
Who do you offer training to? (Select all that apply)
'training_audience', 'hide_empty' => false]); $selected_audience = $user_meta['training_audience']; if (!is_array($selected_audience)) $selected_audience = []; // Ensure it's an array if (!is_wp_error($audience_terms) && !empty($audience_terms)) { foreach ($audience_terms as $term) { echo ''; } } else { // Fallback to hardcoded options if taxonomy not available $audience_options = [ "Anyone (open to the public)" => "Anyone (open to the public)", "Industry professionals" => "Industry professionals", "Internal staff in my company" => "Internal staff in my company", "Registered students/members of my org/institution" => "Registered students/members of my org/institution" ]; foreach ($audience_options as $value => $label) { echo ''; } } ?>
' . esc_html($errors['training_audience']) . '

'; ?>
What formats of training do you offer?
'training_formats', 'hide_empty' => false]); $selected_formats = $user_meta['training_formats']; if (!is_array($selected_formats)) $selected_formats = []; // Ensure it's an array if (!is_wp_error($format_terms) && !empty($format_terms)) { foreach ($format_terms as $term) { echo ''; } } else { // Fallback to hardcoded options if taxonomy not available $format_options = ["In-person", "Virtual", "Hybrid", "On-demand"]; foreach ($format_options as $format) { echo ''; } } ?>
' . esc_html($errors['training_formats']) . '

'; ?>
Where are you willing to provide training? (Select all that apply)
'training_locations', 'hide_empty' => false]); $selected_locations = $user_meta['training_locations']; if (!is_array($selected_locations)) $selected_locations = []; // Ensure it's an array if (!is_wp_error($location_terms) && !empty($location_terms)) { foreach ($location_terms as $term) { echo ''; } } else { // Fallback to hardcoded options if taxonomy not available $location_options = ["Online", "Local", "Regional Travel", "National Travel", "International Travel"]; foreach ($location_options as $location) { echo ''; } } ?>
' . esc_html($errors['training_locations']) . '

'; ?>
What training resources do you have access to? (Select all that apply)
'training_resources', 'hide_empty' => false]); $selected_resources = $user_meta['training_resources']; if (!is_array($selected_resources)) $selected_resources = []; // Ensure it's an array if (!is_wp_error($resource_terms) && !empty($resource_terms)) { foreach ($resource_terms as $term) { echo ''; } } else { // Fallback to hardcoded options if taxonomy not available $resource_options = ["Classroom", "Training Lab", "Ducted Furnace(s)", "Ducted Air Handler(s)", "Ducted Air Conditioner(s)", "Ducted Heat Pump(s)", "Ductless Heat Pump(s)", "Training Manuals", "Presentation Slides", "LMS Platform / SCORM Files", "Custom Curriculum", "Other"]; foreach ($resource_options as $resource) { echo ''; } } ?>
' . esc_html($errors['training_resources']) . '

'; ?>

Revenue Information

It's our goal to help you generate revenue through your training. How much revenue are you looking to generate annually though your training on Upskill HVAC?

Change Password (optional)

Leave these fields blank if you do not wish to change your password.

' . esc_html($errors['current_password']) . '

'; ?>
Password must be at least 8 characters long, and include at least one uppercase letter, one lowercase letter, and one number. ' . esc_html($errors['new_password']) . '

'; ?>
' . esc_html($errors['confirm_new_password']) . '

'; ?>