Filters and hooks

You can find the source of the listed filters in the /book-an-appointment/libs/hooks.php file!

Appearance filters

  • Display data in calendar
    		function book_an_appointment_961_booking_render_content_html($data) {
    			$data = unserialize($data);
    			return $html;
    		}
    		add_filter( 'book_an_appointment_961_booking_content', 'book_an_appointment_961_booking_render_content_html', 10, 1 );
  • Month table start and heading
    		book_an_appointment_961_month_table_before($month) {
    			// $month = "2020-12";
    			return $html;
    		}
    		add_filter( 'book_an_appointment_month_table_before', 'book_an_appointment_961_month_table_before', 10, 1 );
  • End of month table
    		book_an_appointment_961_month_table_after() {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_month_table_after', 'book_an_appointment_961_month_table_after', 10 );
  • Month table header
    		book_an_appointment_961_month_table_header($days) {
    			// $days = array();
    			return $html;
    		}
    		add_filter( 'book_an_appointment_month_table_header', 'book_an_appointment_961_month_table_header', 10, 1 );
  • Month table, start of week (line)
    		function book_an_appointment_961_week_before() {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_week_before', 'book_an_appointment_961_week_before', 10);
  • Month table, end of week (line)
    		function book_an_appointment_961_week_after() {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_week_after', 'book_an_appointment_961_week_after', 10);
  • Month table, empty day
    		function book_an_appointment_961_empty_day() {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_empty_day', 'book_an_appointment_961_empty_day', 10);
  • Month table, one day
    		function book_an_appointment_961_one_day($class, $script, $id, $day) {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_one_day', 'book_an_appointment_961_one_day', 10, 4);
  • Month table, link to previous month
    		function book_an_appointment_961_prev_link($month, $script, $mode) {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_prev_link', 'book_an_appointment_961_prev_link', 10, 3);
  • Month table, next month link
    		function book_an_appointment_961_next_link($month, $script) {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_next_link', 'book_an_appointment_961_next_link', 10, 2);
  • Month table footer
    		function book_an_appointment_961_month_table_footer($prev, $next) {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_month_table_footer', 'book_an_appointment_961_month_table_footer', 10, 2);
  • Display a time
    		function book_an_appointment_961_one_time($time, $script, $class = '') {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_one_time', 'book_an_appointment_961_one_time', 10, 3);
  • Display error message
    		function book_an_appointment_961_show_error($text) {
    			return $html;
    		}
    		add_filter( 'book_an_appointment_show_error', 'book_an_appointment_961_show_error', 10, 1);

Function modifying filters

  • Before generating a booking form
    		function book_an_appointment_961_modify_args_before_form_render($args) {
    			// $args = array();
    			// Data to be passed to the template
    			return args;
    		}
    		add_filter('book_an_appointment_modify_args_before_form_render', 'book_an_appointment_961_modify_args_before_form_render', 10, 1);
    		
  • Email calendar entry attachment (* .ics) before generation
    		function book_an_appointment_961_before_event_generate($data) {
    			// event.ics data manipulation
        		// $data['location'] = 'e.g. custom address setting';
        		return $data;
    		}
    		add_filter( 'book_an_appointment_before_event_generate', 'book_an_appointment_961_before_event_generate', 10, 1 );
  • Before sending a confirmation email
    		book_an_appointment_961_before_confirmation_mail($token, $data) {
    			return $data;
    		}
    		add_filter('book_an_appointment_before_confirmation_mail', 'book_an_appointment_961_before_confirmation_mail', 10, 2);
  • After sending a confirmation email
    (Not defined, but will be called if it exists.)

    		function book_an_appointment_961_after_confirmation_mail($token, $data) {
    			// Custom functions
    		}
    		add_action('book_an_appointment_after_confirmation_mail', 'book_an_appointment_961_after_confirmation_mail', 10, 2);
  • After confirmation by customer
    (Not defined, but will be called if it exists.)

    		function book_an_appointment_961_after_user_confirmation($token) {
        		// [...]
    		}
    		add_action('book_an_appointment_after_user_confirmation', 'book_an_appointment_961_after_user_confirmation', 10, 1);
  • After cancellation by customer
    (Not defined, but will be called if it exists.)

    		function book_an_appointment_961_after_user_cancelled($token) {
        		// [...]
    		}
    		add_action('book_an_appointment_after_user_cancelled', 'book_an_appointment_961_after_user_cancelled', 10, 1);