Back to Developer Guides

This guide applies to:

  • Basic Edition
  • Plus Edition
  • Pro Edition
  • Business Edition

Description

WordPress filter that enables access to the customer information defaults that Simply Schedule Appointments uses to auto-fill the booking form for logged-in users.

At the moment, only the Name and Email are auto-filled, but using this Filter allows you to add new custom variables to automatically auto-fill when a user is logged in.

Learn about the Auto-populate behavior for the Name and Email fields for WordPress users.

Placement

This code should be placed in the file of your custom plugin.

Source Code

This filter is located in the SSA_Customer_Information::get_defaults() function in class-customer-information.php.


Usage for ssa/appointments/ customer_information/get_defaults Filter

add_filter(
	'ssa/appointments/customer_information/get_defaults',
	'new_function_name',
	1,
	1
);

Parameters

  • $defaults array
    The variables of the customer information, this includes Name and Email as defaults.

Example – Customize Default Customer Information

add_filter(
	'ssa/appointments/customer_information/get_defaults',
	'ssa_customize_customer_information_defaults',
	1,
	1
);

function ssa_customize_customer_information_defaults( $defaults ) {
	$defaults = array_merge( $defaults, array(
		// automatically populate the Address field in SSA with data from the user's profile
		'Address' => get_user_meta( get_current_user_id(), 'address', true )
	) );
	
	return $defaults;
}

Still stuck?

File a support ticket with our five-star support team to get more help.

File a ticket

  • Please provide any information that will be helpful in helping you get your issue fixed. What have you tried already? What results did you expect? What did you get instead?
  • This field is for validation purposes and should be left unchanged.


Related Guides