The default items in the drop-down list of attributes for clients and agents are set to those provided with a basic installation of WordPress. However, other plugins usually add additional fields to the user profile screen which will not show up in this list. For example WooCommerce adds billing and shipping fields to the user profile. Even Awesome Support itself adds additional fields.
In order to use these additional user profile attributes your developer will need to customize the drop-down list of attributes by hooking into a couple of filters we provided with the add-on. If you don’t understand what this means please consult a WordPress developer.
add_filter( 'asre_client_attr', 'new_client_attribute', 10, 1);
function new_client_attribute( $client_attr ){
$client_attr['user_meta_key'] = 'User Meta Title';
return $client_attr;
}
add_filter( 'asre_agent_attr', 'new_agent_attribute', 10, 1);
function new_agent_attribute( $agent_attr ){
$agent_attr['wpas_can_be_assigned'] = 'Can Be Assigned';
return $agent_attr;
}
add_filter( 'asre_zapier_client_attributes','set_zapier_client_addl_attributes', 10, 2 );
public function set_zapier_client_addl_attributes( $zapier_data, $author_id ) {
$zapier_data['client_wpas_mobile_phone'] = get_user_option( 'wpas_mobile_phone', $author_id );
$zapier_data['client_wpas_office_phone'] = get_user_option( 'wpas_office_phone', $author_id );
$zapier_data['client_wpas_home_phone'] = get_user_option( 'wpas_home_phone', $author_id );
$zapier_data['client_wpas_other_phone'] = get_user_option( 'wpas_other_phone', $author_id );
return $zapier_data ;
}
Notes: The client attribute key is prefixed by the word “client_”. So if the user meta is called ‘wpas_mobile_phone’, the attribute key in the array is ‘client_wpas_mobile_phone’.
add_filter( 'asre_zapier_agent_attributes','set_zapier_agent_addl_attributes', 10, 2 );
public function set_zapier_agent_addl_attributes( $zapier_data, $agent_id ) {
$zapier_data['agent_wpas_mobile_phone'] = get_user_option( 'wpas_mobile_phone', $agent_id );
$zapier_data['agent_wpas_office_phone'] = get_user_option( 'wpas_office_phone', $agent_id );
$zapier_data['agent_wpas_home_phone'] = get_user_option( 'wpas_home_phone', $agent_id );
$zapier_data['agent_wpas_other_phone'] = get_user_option( 'wpas_other_phone', $agent_id );
return $zapier_data ;
}
Notes: The agent attribute key is prefixed by the word “agent_”. So if the user meta is called ‘wpas_mobile_phone’, the attribute key in the array is ‘agent_wpas_mobile_phone’.
add_filter( 'asre_zap_test_data','zap_test_data' );
public function zap_test_data( $zapier_test_data ) {
$zapier_test_data['agent_wpas_mobile_phone'] = 'Agent Mobile Phone (+12125551212)';
$zapier_test_data['agent_wpas_office_phone'] = 'Agent Office Phone (+12125551212)';
$zapier_test_data['agent_wpas_home_phone'] = 'Agent Home Phone (+12125551212)';
$zapier_test_data['agent_wpas_other_phone'] = 'Agent Other Phone (+12125551212)';
$zapier_test_data['client_wpas_mobile_phone'] = 'Client Mobile Phone (+12125551212)';
$zapier_test_data['client_wpas_office_phone'] = 'Client Office Phone (+12125551212)';
$zapier_test_data['client_wpas_home_phone'] = 'Client Home Phone (+12125551212)';
$zapier_test_data['client_wpas_other_phone'] = 'Client Other Phone (+12125551212)';
return $zapier_test_data ;
}