Secure an Exclusive 20% Discount on Lifetime Access - Limited Time Offer. Use code: LIFETIME20
Developer’s Guide

Filters

Estimated reading: 39 minutes 217 views

1. File:class-gfb-appointment.php

  • Filter: gfb_product_info
  • Data Type
  •  Array: $product_info – The product information to be modified.
  • Arguments
  1. (Array): $product_info – The product information to be modified.
  • Usage
  • This filter allows you to modify the product information before it is returned. You can use this filter to adjust any aspect of the product information, such as price, name, or description.
```php
function custom_modify_product_info($product_info) {
    // Example: Increase the price by $10
    $product_info[‘products’][‘appointment_cost’][‘price’] += 10;
    return $product_info;
}
add_filter('gfb_product_info', 'custom_modify_product_info', 10, 1);

1. gfb_add_appointment_args

  • This filter allows you to modify the arguments used when adding or updating an appointment.
  • Data Type
  • Array
  • Arguments
  • `$args` (Array): An array containing the appointment arguments.
  •  Usage
  • You can use this filter to customize the appointment arguments before they are used to add or update an appointment post.

```php
// Define a filter for modifying appointment args
function custom_gfb_appointment_args_filter( $args ) {
    // Modify the $args array here as needed
    $args['custom_key'] = 'custom_value'; // Example modification
    
    // Return the modified $args array
    return $args;
}
add_filter( 'gfb_add_appointment_args', 'custom_gfb_appointment_args_filter' )

2. Filter: gfb_appointment_change_csv_name

  • This filter allows you to modify the default name used for the CSV file when exporting appointments.
  • Data Type
  • String
  • Arguments
  • `$site_name` (String): The default site name for the CSV file.
  • Usage
  • You can use this filter to customize the default CSV file name used for exporting appointments.
```php
// Define a filter for modifying the CSV file name
function custom_gfb_appointment_csv_name_filter( $site_name ) {
 // Modify the $site_name string here as needed
 $modified_name = $site_name . '_modified'; // Example modification
 
 // Return the modified $site_name string
 return $modified_name;
}
add_filter( 'gfb_appointment_change_csv_name', 'custom_gfb_appointment_csv_name_filter' );

3. Filter: gfb_appointment_export_header

  • This filter allows you to modify the default header column names for appointment exports.
  • Data Type
  • Array
  • Arguments
  1. `$header_column` (Array): An array containing the default header column names for the appointment export.
  2. `$export_type` (String): The type of export being performed, such as CSV or Excel.
  • Usage
  • You can use this filter to customize the default header column names for appointment exports.
```php
// Define a filter for modifying the header column names
function custom_gfb_appointment_export_header_filter( $header_column, $export_type ) {
    // Modify the $header_column array here as needed
    // Example modification: appending a new column name
    $header_column[] = esc_html__('New Column', 'gfb');
    
    // Return the modified $header_column array
    return $header_column;
}
add_filter( 'gfb_appointment_export_header', 'custom_gfb_appointment_export_header_filter', 10, 2 );

4. Filter: gfb_appointment_export_cell_width

  • This filter allows you to modify the default width values for each cell in the appointment export table.
  • Data Type
  • Array
  • Arguments
  1. `$width_cell` (Array): An array containing the default width values for each cell in the appointment export table.
  • Usage
  • You can use this filter to customize the width of cells in the appointment export table.
```php
// Define a filter for modifying the cell widths
function custom_gfb_appointment_export_cell_width_filter( $width_cell ) {
    // Modify the $width_cell array here as needed
    // Example modification: changing the width of the first cell
    $width_cell[0] = 30;
    
    // Return the modified $width_cell array
    return $width_cell;
}
add_filter( 'gfb_appointment_export_cell_width', 'custom_gfb_appointment_export_cell_width_filter' );

5. Filter: gfb_appointment_export_cell_height

  • This filter allows you to modify the default height value for each cell in the appointment export table.
  • Data Type
  • Integer
  • Arguments
  1. `$height_cell` (Integer): The default height value for each cell in the appointment export table.
  • Usage
  • You can use this filter to customize the height of cells in the appointment export table.
```php
// Define a filter for modifying the cell height
function custom_gfb_appointment_export_cell_height_filter( $height_cell ) {
    // Modify the $height_cell value here as needed
    // Example modification: changing the cell height to 15
    $height_cell = 15;
    
    // Return the modified $height_cell value
    return $height_cell;
}
add_filter( 'gfb_appointment_export_cell_height', 'custom_gfb_appointment_export_cell_height_filter' );

6. Filter: gfb_change_pdf_font

  • This filter allows you to modify the default font family used in the PDF generated by the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • String
  • Arguments
  1. `$font_family` (String): The default font family used in the PDF.
  • Usage
  • You can use this filter to customize the font family used in the PDF generated by the GFB plugin.
```php
// Define a filter for modifying the font family
function custom_gfb_change_pdf_font_filter( $font_family ) {
    // Modify the $font_family value here as needed
    // Example modification: changing the font family to 'Times'
    $font_family = 'Times';
    
    // Return the modified $font_family value
    return $font_family;
}
add_filter( 'gfb_change_pdf_font', 'custom_gfb_change_pdf_font_filter' );

7. Filter: gfb_appointment_export_header

  • This filter allows you to modify the column headers for the appointment export in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • Array
  • Arguments
  1. ‘$header_columns` (Array): An array containing the column headers for the appointment export.
  2. `$export_type` (String): The type of export being performed (e.g., ‘csv’, ‘pdf’).
  • Usage
  • You can use this filter to customize the column headers displayed in the appointment export.
```php
// Define a filter for modifying the column headers
function custom_gfb_appointment_export_header_filter( $header_columns, $export_type ) {
    // Modify the $header_columns array here as needed
    // Example modification: adding a new column header
    $header_columns[] = esc_html__( 'New Column', 'gfb' );
    
    // Return the modified $header_columns array
    return $header_columns;
}
add_filter( 'gfb_appointment_export_header', 'custom_gfb_appointment_export_header_filter', 10, 2 );

8. Filter: gfb_add_admin_appointment_args

  • This filter allows you to modify the arguments for adding an appointment in the admin area of the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • Array
  • Arguments
  1. `$args` (Array): An array containing the arguments for adding an appointment.
  2. `$wp_user` (Integer): The WordPress user ID associated with the appointment.
  3. `$gfb_customer` (Integer): The GFB customer ID associated with the appointment.
  4. `$location_id` (Integer): The ID of the location where the appointment will take place.
  5. `$service_id` (Integer): The ID of the service for the appointment.
  6. `$staff_id` (Integer): The ID of the staff member assigned to the appointment.
  7. `$date` (String): The date of the appointment.
  8. `$time` (String): The time of the appointment.
  9. `$slot` (Integer): The slot number of the appointment.
  10. `$cost` (String): The cost of the appointment.
  • Usage
  • You can use this filter to modify the arguments before adding an appointment in the admin area of the GFB plugin.
```php
// Define a filter for modifying the arguments for adding an appointment
function custom_gfb_add_admin_appointment_args_filter( $args, $wp_user, $gfb_customer, $location_id, $service_id, $staff_id, $date, $time, $slot, $cost ) {
    // Modify the $args array here as needed
    // Example modification: adding a new meta_input key-value pair
    $args['meta_input']['custom_key'] = 'custom_value';
    
    // Return the modified $args array
    return $args;
}
add_filter( 'gfb_add_admin_appointment_args', 'custom_gfb_add_admin_appointment_args_filter', 10, 10 );

9. Filter: gfb_staff_time_slot

  • This filter allows you to modify the time slot value for a staff member in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • String
  • Arguments
  1. `$time` (String): The time slot value.
  2. `$staffData` (Array): An array containing data related to the staff member.
  • Usage
  • You can use this filter to modify the time slot value for a staff member in the GFB plugin.
```php
// Define a filter for modifying the time slot value for a staff member
function custom_gfb_staff_time_slot_filter( $time, $staffData ) {
    // Modify the $time string here as needed
    // Example modification: appending a suffix to the time slot
    $modified_time = $time . ' (Modified)';
    
    // Return the modified time slot value
    return $modified_time;
}
add_filter( 'gfb_staff_time_slot', 'custom_gfb_staff_time_slot_filter', 10, 2 );

10. Filter: gfb_staff_date_slot

  • This filter allows you to modify the date value for a staff member in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • String
  • Arguments
  • `$date` (String): The date value.
  • Usage
  • You can use this filter to modify the date value for a staff member in the GFB plugin.
```php
// Define a filter for modifying the date value for a staff member
function custom_gfb_staff_date_slot_filter( $date ) {
    // Modify the $date string here as needed
    // Example modification: appending a suffix to the date
    $modified_date = $date . ' (Modified)';
    // Return the modified date value
    return $modified_date;
}
add_filter( 'gfb_staff_date_slot', 'custom_gfb_staff_date_slot_filter', 10, 1 );

11. Filter: gfb_appointment_time_format

  • This filter allows you to modify the time format for appointments in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • String
  • Arguments
  1. `$time` (String): The time value.
  • Usage
  • You can use this filter to modify the time format for appointments in the GFB plugin.
```php
// Define a filter for modifying the time format for appointments
function custom_gfb_appointment_time_format_filter( $time ) {
    // Modify the $time string here as needed
    // Example modification: converting time to 12-hour format
    $modified_time = date('h:i A', strtotime($time));
    
    // Return the modified time value
    return $modified_time;
}
add_filter( 'gfb_appointment_time_format', 'custom_gfb_appointment_time_format_filter', 10, 1 );

12. Filter: gfb_appointment_date_format

  • This filter allows you to modify the date format for appointments in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • String
  • Arguments
  1. `$date` (String): The date value.
  • Usage
  • You can use this filter to modify the date format for appointments in the GFB plugin.
```php
// Define a filter for modifying the date format for appointments
function custom_gfb_appointment_date_format_filter( $date ) {
    // Modify the $date string here as needed
    // Example modification: converting date to a different format
    $modified_date = date('Y-m-d', strtotime($date));
    
    // Return the modified date value
    return $modified_date;
}
add_filter( 'gfb_appointment_date_format', 'custom_gfb_appointment_date_format_filter', 10, 1 );

13 Filter: gfb_appointment_columns

  • This filter allows you to modify the columns displayed in the appointment list table in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • Array
  • Arguments
  1. $columns` (Array): An associative array containing column keys and their corresponding labels.
  • Usage
  • You can use this filter to modify or add columns in the appointment list table in the GFB plugin.
```php
// Define a filter for modifying or adding appointment list table columns
function custom_gfb_appointment_columns_filter( $columns ) {
    // Modify or add columns to the appointment list table
    $columns['new_column'] = __('New Column', 'gfb');
    
    // Return the modified or added columns array
    return $columns;
}
add_filter( 'gfb_appointment_columns', 'custom_gfb_appointment_columns_filter', 10, 1 );

14. Filter: gfb_all_appointment_by_date_time_service

  • This filter allows you to control whether all appointments are fetched based on date, time, and service in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • Boolean
  • Arguments
  • `$default` (Boolean): The default value of the filter.
  • Usage
  • You can use this filter to modify the behavior of fetching appointments based on date, time, and service in the GFB plugin.
```php
// Define a filter for controlling appointment fetching based on date, time, and service
function custom_gfb_all_appointment_by_date_time_service_filter( $default ) {
    // Modify the default behavior
    $default = true;
    
    // Return the modified value
    return $default;
}
add_filter( 'gfb_all_appointment_by_date_time_service', 'custom_gfb_all_appointment_by_date_time_service_filter', 10, 1 );

15. Filter: gfb_all_appointment_by_date_time_location

  • This filter allows you to control whether all appointments are fetched based on date, time, and location in the GFB (Gravity Forms Booking) plugin.
  • Data Type
  • Boolean
  • Arguments
  1. $default` (Boolean): The default value of the filter.
  • Usage
  • You can use this filter to modify the behavior of fetching appointments based on date, time, and location in the GFB plugin.
```php
// Define a filter for controlling appointment fetching based on date, time, and location
function custom_gfb_all_appointment_by_date_time_location_filter( $default ) {
    // Modify the default behavior
    $default = true;
    
    // Return the modified value
    return $default;
}
add_filter( 'gfb_all_appointment_by_date_time_location', 'custom_gfb_all_appointment_by_date_time_location_filter', 10, 1 );

16.  Filter: initiated_create_appointment

  • This filter allows you to control whether the creation of an appointment is initiated in a specific context.
  • Data Type
  • Boolean
  • Arguments
  1. $default` (Boolean): The default value of the filter.
  2. `$date` (String): The date of the appointment.
  3. `$time` (String): The time of the appointment.
  4. `$_POSTED` (Array): The data posted for creating the appointment.
  • Usage
  • You can use this filter to modify the behavior of initiating the creation of an appointment in a specific context.
```php
// Define a filter for controlling the initiation of appointment creation
function custom_initiated_create_appointment_filter( $default, $date, $time, $_POSTED ) {
    // Modify the default behavior based on specific conditions
    if (/* add your condition here */) {
        $default = true; // or false based on your condition
    }
    
    // Return the modified value
    return $default;
}
add_filter( 'initiated_create_appointment', 'custom_initiated_create_appointment_filter', 10, 4 );

2. File:class-gfb-calendar.php

17. Filter: gfb_check_current_time

  • This filter allows you to modify the current date and time used in the system.
  • Data Type
  • String
  • Arguments
  1. `$current_time` (String): The current date and time in the ‘Y-m-d H:i’ format.
  • Usage
  • You can use this filter to adjust the current date and time used in the system according to specific requirements.
```php
// Define a filter for modifying the current time
function custom_gfb_check_current_time_filter( $current_time ) {
    // Modify the current time based on specific conditions
 // For example, you can set a custom current time
    $custom_current_time = '2024-04-20 08:00'; // Modify the time as needed
    
    // Return the modified current time
    return $custom_current_time;
}
add_filter( 'gfb_check_current_time', 'custom_gfb_check_current_time_filter' );

18.  Filter: gfb_staff_time_slot_capacity_placeholder

  • This filter allows you to modify the placeholder for staff time slots.
  • Data Type
  • String
  • Arguments
  1. (String): Placeholder
  •  Usage
  • You can use this filter to adjust the placeholder according to specific requirements.
// Define a filter for modifying the placeholder text for staff time slot capacity
function custom_gfb_staff_time_slot_capacity_placeholder_filter( $placeholder ) {
    // Modify the placeholder text as needed
    $custom_placeholder = __('Enter Slot Capacity', 'gfb'); // Modify the text as needed
    
    // Return the modified placeholder text
    return $custom_placeholder;
}
add_filter( 'gfb_staff_time_slot_capacity_placeholder', 'custom_gfb_staff_time_slot_capacity_placeholder_filter' );

19.  Filter: gfb_show_default_capacity

  • Data Type
  • integer
  • Arguments
  1. (integer): $default capacity
  2. (integer): $remaining capacity
  •  Usage
  • This filter allows you to modify the default capacity shown. You can use this filter to adjust the default capacity based on specific conditions.
function custom_show_default_capacity($default_capacity, $remaining_capacity) {
    // Example modification based on remaining capacity
    if ($remaining_capacity < 5) {
        $default_capacity += 10; // Increase default capacity by 10 if remaining capacity is less than 5
    }
    
    return $default_capacity;
}
add_filter('gfb_show_default_capacity', 'custom_show_default_capacity', 10, 2);

20. Filter: gfb_show_slot_list

  • Data Type
  • Boolean
  • Arguments
  •  (Boolean): $show_slot_list – Whether to show the slot list.
  •  Usage
  • This filter allows you to control whether to show the slot list. You can use this filter to modify the behavior based on specific conditions. In the provided example, the slot list is always shown by returning `true`.
function custom_show_slot_list($show_slot_list) {
    // Example modification: always show the slot list
    return true;
}
add_filter('gfb_show_slot_list', 'custom_show_slot_list');

21. Filter: gfb_slot_title

  • Data Type
  •  String
  • Arguments
  1.  (String): $slot_title – The slot title.
  2. (String): $month_name – The name of the month.
  3. (String): $formatted_date – The formatted date.
  4. (String): $posted_date – The posted date.
  •  Usage
  • This filter allows you to modify the slot title. You can use this filter to customize the slot title based on specific requirements. In the provided example, the posted date is appended to the slot title.
function custom_slot_title($slot_title, $month_name, $formatted_date, $posted_date) {
    // Example modification: append the posted date to the slot title
    $modified_slot_title = $slot_title . ' - ' . $posted_date;
    return $modified_slot_title;
}
add_filter('gfb_slot_title', 'custom_slot_title', 10, 4);

22. Filter: gfb_modify_service_price

  • Data Type
  •  Float
  • Arguments
  1. (Float): $service_price – The service price.
  2. (String): $posted_date – The posted date.
  3. (String): $day_name – The name of the day.
  4. (String): $start_time – The start time.
  5. (String): $end_time – The end time.
  •  Usage
  • This filter allows you to modify the service price. You can use this filter to customize the service price based on specific requirements. In the provided example, the service price is increased by 10%.
function custom_modify_service_price($service_price, $posted_date, $day_name, $start_time, $end_time) {
    // Example modification: increase the service price by 10%
$modified_price = $service_price * 1.1; // Increase by 10%
    return $modified_price;
}
add_filter('gfb_modify_service_price', 'custom_modify_service_price', 10, 5);

23. Filter: gfb_location_error

  • Data Type
  • String
  • Arguments
  1.  (String): $location_error – The location error message.
  •  Usage
  • This filter allows you to modify the location error message. You can use this filter to customize the error message based on specific requirements. In the provided example, the error message is changed to “Please choose a valid location.”
function custom_location_error_message($location_error) {
    // Example modification: change the error message
    $modified_message = __('Please choose a valid location.', 'gfb');
    return $modified_message;
}
add_filter('gfb_location_error', 'custom_location_error_message');

24. Filter: gfb_service_error

  • Data Type
  • String
  • Arguments
  1.  (String): $service_error – The service error message.
  •  Usage
  • This filter allows you to modify the service error message. You can use this filter to customize the error message based on specific requirements. In the provided example, the error message is changed to “Please choose a service from the list.”
function custom_service_error_message($service_error) {
    // Example modification: change the error message
    $modified_message = __('Please choose a service from the list.', 'gfb');
    return $modified_message;
}
add_filter('gfb_service_error', 'custom_service_error_message');

25. Filter: gfb_staff_error

  • Data Type
  • String
  • Arguments
  1.  (String): $staff_error – The staff error message.
  •  Usage
  • This filter allows you to modify the staff error message. You can use this filter to customize the error message based on specific requirements. In the provided example, the error message is changed to “Please select a staff member.”
function custom_staff_error_message($staff_error) {
    // Example modification: change the error message
    $modified_message = __('Please select a staff member.', 'gfb');
    return $modified_message;
}
add_filter('gfb_staff_error', 'custom_staff_error_message');

3. File:class-gfb-customer.php

26.  Filter: gfb_customer_remove_admin_toolbar

  • Data Type
  • Boolean
  • Arguments
  1.  (Boolean): $show – Whether to show or hide the admin toolbar.
  •  Usage
  • This filter allows you to modify whether to remove the admin toolbar for customers. You can use this filter to customize the behavior based on specific requirements. In the provided example, the admin toolbar is always hidden for customers.
function custom_remove_admin_toolbar_for_customers($show) {
    // Example modification: always hide the admin toolbar for customers
    return false;
}
add_filter('gfb_customer_remove_admin_toolbar', 'custom_remove_admin_toolbar_for_customers');

27.  Filter: gfb_customer_change_csv_name

  • Data Type
  • String
  • Arguments
  1.  (String): $csv_name – The CSV file name.
  •  Usage
  • This filter allows you to modify the CSV file name for customer exports. You can use this filter to customize the file name based on specific requirements. In the provided example, ‘_export’ is appended to the CSV file name.
function custom_change_csv_name_for_customers($csv_name) {
    // Example modification: append '_export' to the CSV file name
    $modified_name = $csv_name . '_export';
    return $modified_name;
}
add_filter('gfb_customer_change_csv_name', 'custom_change_csv_name_for_customers')

28.  Filter: gfb_customer_export_header

  • Data Type
  • Array
  • Arguments
  1. (Array): $header_columns – The header columns.
  2. (String): $export_type – The export type.
  •  Usage
  • This filter allows you to modify the header columns for customer exports. You can use this filter to customize the header columns based on specific requirements. In the provided example, a new column ‘Address’ is added to the header columns.
function custom_modify_export_header_columns($header_columns, $export_type) {
    // Example modification: add a new column 'Address' to the header columns
    $header_columns[] = esc_html__('Address', 'gfb');
    return $header_columns;
}
add_filter('gfb_customer_export_header', 'custom_modify_export_header_columns', 10, 2);

29.  Filter: gfb_customer_export_cell_width

  • Data Type
  • Array
  • Arguments
  1. (Array): $cell_widths – The cell widths.
  •  Usage
  • This filter allows you to modify the cell widths for customer exports. You can use this filter to customize the cell widths based on specific requirements. In the provided example, the width of the first cell is increased to 40.
function custom_modify_export_cell_widths($cell_widths) {
    // Example modification: increase the width of the first cell
    $cell_widths[0] = 40;
    return $cell_widths;
}
add_filter('gfb_customer_export_cell_width', 'custom_modify_export_cell_widths');

30.   Filter: gfb_customer_export_cell_height

  • Data Type
  •  Integer
  • Arguments
  1.  (Integer): $cell_height – The cell height.
  •  Usage
  • This filter allows you to modify the cell height for customer exports. You can use this filter to customize the cell height based on specific requirements. In the provided example, the cell height is increased to 15.
function custom_modify_export_cell_height($cell_height) {
    // Example modification: increase the cell height to 15
    return 15;
}
add_filter('gfb_customer_export_cell_height', 'custom_modify_export_cell_height');

31.   Filter: gfb_customer_appointments_template

  • Data Type
  •  String
  • Arguments
  1.  (String): $template_path – The template path.
  •  Usage
  • This filter allows you to modify the template path for customer appointments. You can use this filter to customize the template path based on specific requirements. In the provided example, the template path is changed to a custom location.
function custom_modify_customer_appointments_template($template_path) {
    // Example modification: change the template path to a custom location
    return '/path/to/custom/customer-appointments.php';
}
add_filter('gfb_customer_appointments_template', 
add_filter('gfb_customer_appointments_template', 

'custom_modify_customer_appointments_template');

32.   Filter: gfb_edit_customer_args

  • Data Type
  • Array
  • Arguments
  1.  (Array): $args – The arguments passed for editing a customer. It includes:
  2.    ID’ (int): The ID of the customer.
  3.    ‘post_title’ (string): The post title of the customer.
  4.    ‘post_type’ (string): The post type of the customer post.
  5.    ‘post_status’ (string): The post status of the customer post.
  6.    ‘wp_error’ (bool): Whether to return a WP_Error object on failure.
  7.   ‘meta_input’ (array): Array of meta key/value pairs for the customer.
  •  Usage
  • This filter allows you to modify the arguments for editing a customer. You can use this filter to customize the arguments based on specific requirements. In the provided example, a default value is added to the `additional_field` meta field.
function custom_modify_edit_customer_args($args) {
    // Example modification: set a default value for a meta field
    $args['meta_input']['additional_field'] = 'default_value';
    return $args;
}
add_filter('gfb_edit_customer_args', 'custom_modify_edit_customer_args');

33. Filter: gfb_edit_customer_personal_details_notification

  • Data Type
  • Boolean
  • Arguments
  1.  (Boolean): $send_notification – Whether to send the notification.
  •  Usage
  • This filter allows you to control whether to send a notification for editing customer personal details. You can use this filter to customize the behavior based on specific requirements. In the provided example, the notification is always sent.
/**
 * Control whether to send a notification for editing customer personal details.
 *
 * @param bool $send_notification Whether to send the notification.
 * @return bool Modified value for sending the notification.
 */
function custom_edit_customer_personal_details_notification($send_notification) {
    // Example modification: always send the notification
    return true;
}
add_filter('gfb_edit_customer_personal_details_notification', 'custom_edit_customer_personal_details_notification');

34.  Filter: gfb_add_customer_args

  • Data Type
  • Array
  • Arguments
  1. (Array): $args – The arguments passed for adding a customer. It includes:
  2.    ‘post_title’ (string): The post title of the customer.
  3.    ‘post_type’ (string): The post type of the customer post.
  4.    ‘post_status’ (string): The post status of the customer post.
  5.    ‘wp_error’ (bool): Whether to return a WP_Error object on failure.
  6.   ‘meta_input’ (array): Array of meta key/value pairs for the customer.
  •  Usage
  • This filter allows you to modify the arguments for adding a customer. You can use this filter to customize the arguments based on specific requirements. In the provided example, additional meta data is added to the customer’s meta input.
function custom_modify_add_customer_args($args) {
    // Example modification: add additional meta data
    $args['meta_input']['additional_meta'] = 'additional_value';
    return $args;
}
add_filter('gfb_add_customer_args', 'custom_modify_add_customer_args');

35.  Filter: gfb_add_customer_personal_details_notification

  • Data Type
  • Boolean
  • Arguments
  1. (Boolean): $send_notification – Whether to send the notification.
  •  Usage
  • This filter allows you to control whether to send a notification for adding customer personal details. You can use this filter to customize the behavior based on specific requirements. In the provided example, the notification is always sent.
function custom_send_add_customer_notification($send_notification) {
    // Example modification: always send the notification
    return true;
}
add_filter('gfb_add_customer_personal_details_notification', 'custom_send_add_customer_notification');

4) File:class-gfb-email.php

36.   Filter: gfb_codes

  • Data Type
  • Array
  • Arguments
  1. (Array): $codes – The array of codes used in booking notifications.
  •  Usage
  • This filter allows you to modify the array of codes used in booking notifications. You can use this filter to add, remove, or modify codes based on specific requirements. In the provided example, a new code `{customer_address}` is added for the customer’s address.
function custom_modify_booking_codes($codes) {
    // Example modification: add a new code for the customer's address
    $codes['{customer_address}'] = esc_html__( "address of customer", "gfb" );
    return $codes;
}
add_filter('gfb_codes', 'custom_modify_booking_codes');

37.   Filter: gfb_email_template_footer

  • Data Type
  • String
  • Arguments
  1. (String): $footer – The footer content of an email template.
  •  Usage
  • This filter allows you to modify the footer content of an email template. You can use this filter to add custom footer content based on specific requirements. In the provided example, a custom footer message is appended to the existing footer content.
function custom_modify_email_template_footer($footer) {
    // Example modification: add a custom footer message
    $custom_footer = 'Custom footer message here';
    return $footer . $custom_footer;
}
add_filter('gfb_email_template_footer', 'custom_modify_email_template_footer');

38.   Filter: gfb_get_appointment_details_formatted

  • Data Type
  • Array
  • Arguments
  1. (Array): $data – The appointment details data including various parameters such as appointment ID, customer details, service details, etc.
  •  Usage
  • This filter allows you to modify the appointment details data before formatting. You can use this filter to add or update appointment details based on specific requirements. In the provided example, a custom field is added to the appointment details data.
function custom_modify_appointment_details($data) {
    // Example modification: add or update appointment details
    $data['custom_field'] = 'Custom value';
    return $data;
}
add_filter('gfb_get_appointment_details_formatted', 'custom_modify_appointment_details');

39.  Filter: booking_notification_to_admin

  • Data Type
  • String
  • Arguments
  1.  (String): $to_email – The email address where booking notifications are sent to the admin.
  •  Usage
  • This filter allows you to modify the email address where booking notifications are sent to the admin. You can use this filter to specify a custom email address or perform any other modifications based on specific requirements.
function custom_modify_booking_notification_to_admin($to_email) {
    // Example modification: send booking notifications to a custom email address
    return 'custom@example.com';
}
add_filter('booking_notification_to_admin', 'custom_modify_booking_notification_to_admin');

40.  Filter: gfb_email_template_message

  • Data Type
  • String
  • Arguments
  1.  (String): $template_message – The email template message.
  2. (Array): $data – The appointment data.
  •  Usage
  • This filter allows you to modify the email template message before sending. You can use this filter to customize the email content based on specific requirements. In the provided example, a custom message is appended to the template.
function custom_modify_email_template_message($template_message, $data) {
    // Example modification: append a custom message to the template
    $custom_message = "\n\nCustom message here";
    return $template_message . $custom_message;
}
add_filter('gfb_email_template_message', 'custom_modify_email_template_message', 10, 2);

41.   Filter: booking_notification_to_customer

  • Data Type
  • String
  • Arguments
  1. (String): $to_email – The email address where booking notifications are sent to the customer.
  2. (String): $template_id – The ID of the email template.
  3. (Array): $data – The appointment data.
  •  Usage
  • This filter allows you to modify the email address where booking notifications are sent to the customer. You can use this filter to specify a custom email address or perform any other modifications based on specific requirements.
function custom_modify_booking_notification_to_customer($to_email, $template_id, $data) {
    // Example modification: send booking notifications to a custom email address
    return 'custom@example.com';
}
add_filter('booking_notification_to_customer', 'custom_modify_booking_notification_to_customer', 10, 3);

42.   Filter: booking_notification_to_admin

  • Data Type
  • String
  • Arguments
  1. (String): $to_email – The email address where booking notifications are sent to the admin.
  •  Usage
  • This filter allows you to modify the email address where booking notifications are sent when intended for the admin. You can use this filter to specify a custom email address or perform any other modifications based on specific requirements.
function custom_modify_booking_notification_to_admin($to_email) {
    // Example modification: send booking notifications to a custom admin email address
    return 'custom_admin@example.com';
}
add_filter('booking_notification_to_admin', 'custom_modify_booking_notification_to_admin');

43.  Filter: gfb_new_staff_email_subject

  • Data Type
  • String
  • Arguments
  1. (String): $subject – The email subject for the new staff notification email.
  •  Usage
  • This filter allows you to modify the subject of the email notification sent when a new staff member is added. You can use this filter to customize the subject based on specific requirements.
function custom_modify_new_staff_email_subject($subject) {
    // Example modification: append a custom string to the subject
    return $subject . ' - Custom Subject';
}
add_filter('gfb_new_staff_email_subject', 'custom_modify_new_staff_email_subject');

44.   Filter: gfb_new_staff_email_message

  • Data Type
  • String
  • Arguments
  1. (String): $message – The email message content for the new staff notification email.
  •  Usage
  • This filter allows you to modify the message content of the email notification sent when a new staff member is added. You can use this filter to customize the message based on specific requirements.
function custom_modify_new_staff_email_message($message) {
    // Example modification: append a custom message to the email content
    return $message . "\n\nCustom message content";
}
add_filter('gfb_new_staff_email_message', 'custom_modify_new_staff_email_message');




45.   Filter: gfb_new_customer_email_subject

  • Data Type
  • String
  • Arguments
  1. (String): $subject – The email subject for the new customer notification email.
  •  Usage
  • This filter allows you to modify the subject of the email notification sent when a new customer is added. You can use this filter to customize the subject based on specific requirements.
function custom_modify_new_customer_email_subject($subject) {
    // Example modification: append a custom string to the subject
    return $subject . ' - Custom Subject';
}
add_filter('gfb_new_customer_email_subject', 'custom_modify_new_customer_email_subject');

46.  Filter: gfb_new_customer_email_message

  • Data Type
  • String
  • Arguments
  1. (String): $message – The email message content for the new customer notification email.
  •  Usage
  • This filter allows you to modify the message content of the email notification sent when a new customer is added. You can use this filter to customize the message based on specific requirements.
function custom_modify_new_customer_email_message($message) {
    // Example modification: append a custom message to the email content
    return $message . "\n\nCustom message content";
}
add_filter('gfb_new_customer_email_message', 'custom_modify_new_customer_email_message');




5) File:class-gfb-location.php

47.  Filter: gfb_location_change_csv_name

  • Data Type
  • String
  • Arguments
  1. (String): $csv_name – The CSV file name for location data.
  •  Usage
  • This filter allows you to modify the CSV file name for location data. You can use this filter to customize the file name based on specific requirements.
function custom_modify_location_csv_name($csv_name) {
    // Example modification: append a custom string to the CSV file name
    return $csv_name . '_custom_suffix';
}
add_filter('gfb_location_change_csv_name', 'custom_modify_location_csv_name');

48.   Filter: gfb_location_export_header

  • Data Type
  • String
  • Arguments
  1. (Array): $header_columns – The header columns for location data export.
  2. (String): $export_type – The type of export.
  •  Usage
  • This filter allows you to modify the header columns for location data export. You can use this filter to customize the header columns based on specific requirements, such as adding or removing columns. In the provided example, a custom header column is added.
function custom_modify_location_export_header($header_columns, $export_type) {
    // Example modification: add a custom header column
    $header_columns[] = esc_html__('Custom Column', 'gfb');
    return $header_columns;
}
add_filter('gfb_location_export_header', 'custom_modify_location_export_header', 10, 2);

49.  Filter: gfb_location_export_cell_width

  • Data Type
  • Array
  • Arguments
  1. (Array): $cell_widths – The cell widths for location data export.
  •  Usage
  • This filter allows you to modify the cell widths for location data export. You can use this filter to customize the widths of individual cells based on specific requirements.
function custom_modify_location_export_cell_width($cell_widths) {
    // Example modification: change the width of the first cell
    $cell_widths[0] = 50;
    return $cell_widths;
}
add_filter('gfb_location_export_cell_width', 'custom_modify_location_export_cell_width');

50.   Filter: gfb_location_export_cell_height

  • Data Type
  • Integer
  • Arguments
  1. (Integer): $cell_height – The cell height for location data export.
  •  Usage
  • This filter allows you to modify the cell height for location data export. You can use this filter to customize the height of cells based on specific requirements.
function custom_modify_location_export_cell_height($cell_height) {
    // Example modification: change the cell height to 15
    return 15;
}
add_filter('gfb_location_export_cell_height', 'custom_modify_location_export_cell_height');

51.   Filter: gfb_edit_staff_args

  • Data Type
  • Array
  • Arguments
  1.  (Array): $args – The arguments for editing staff members.
  2. (Array): $data – The data used for editing staff members.
  •  Usage
  • This filter allows you to modify the arguments used when editing staff members. You can use this filter to customize the arguments based on specific requirements, such as changing post titles or adding additional meta data.
function custom_modify_edit_staff_args($args, $data) {
    // Example modification: change the post title to uppercase
    $args['post_title'] = strtoupper($args['post_title']);
    return $args;
}
add_filter('gfb_edit_staff_args', 'custom_modify_edit_staff_args', 10, 2);

52. Filter: gfb_add_location_args

  • Data Type
  • Array
  • Arguments
  1. (Array): $args – The arguments for adding a location.
  2. (Array): $data – The data used for adding a location.
  •  Usage
  • This filter allows you to modify the arguments used when adding a location. You can use this filter to customize the arguments based on specific requirements, such as changing post titles or adding additional meta data.
function custom_modify_add_location_args($args, $data) {
    // Example modification: change the post title to uppercase
    $args['post_title'] = strtoupper($args['post_title']);
    return $args;
}
add_filter('gfb_add_location_args', 'custom_modify_add_location_args', 10, 2);

6)File:class-gfb-service.php

53.   Filter: gfb_service_change_csv_name

  • Data Type
  • String
  • Arguments
  1. (String): $csv_name – The CSV file name for service data.ate.
  •  Usage
  • This filter allows you to modify the CSV file name for service data. You can use this filter to customize the file name based on specific requirements.
function custom_modify_service_csv_name($csv_name) {
    // Example modification: append a custom string to the CSV file name
    return $csv_name . '_custom_suffix';
}
add_filter('gfb_service_change_csv_name', 'custom_modify_service_csv_name')

54.    Filter: gfb_service_export_header

  • Data Type
  • Array
  • Arguments
  1. (Array): $header_columns – The header columns for service data export.
  2. (String): $export_type – The type of export.
  •  Usage
  • This filter allows you to modify the header columns for service data export. You can use this filter to customize the header columns based on specific requirements, such as adding or removing columns. In the provided example, a custom header column is added.
function custom_modify_service_export_header($header_columns, $export_type) {
    // Example modification: add a custom header column
    $header_columns[] = esc_html__('Custom Column', 'gfb');
    return $header_columns;
}
add_filter('gfb_service_export_header', 'custom_modify_service_export_header', 10, 2);

55.   Filter: gfb_email_template_footer

  • Data Type
  • Array
  • Arguments
  1. (Array): $cell_widths – The cell widths for service data export.
  •  Usage
  • This filter allows you to modify the cell widths for service data export. You can use this filter to customize the widths of individual cells based on specific requirements.
function custom_modify_service_export_cell_width($cell_widths) {
    // Example modification: change the width of the first cell
    $cell_widths[0] = 50;
    return $cell_widths;
}
add_filter('gfb_service_export_cell_width', 'custom_modify_service_export_cell_width');

56.  Filter: gfb_service_export_cell_height

  • Data Type
  • Integer
  • Arguments
  1.  (Integer): $cell_height – The cell height for service data export.
  •  Usage
  • This filter allows you to modify the cell height for service data export. You can use this filter to customize the height of cells based on specific requirements.
function custom_modify_service_export_cell_height($cell_height) {
    // Example modification: change the cell height to 15
    return 15;
}
add_filter('gfb_service_export_cell_height', 'custom_modify_service_export_cell_height')

57.   Filter: gfb_edit_service_args

  • Data Type
  • Array
  • Arguments
  1. (Array): $args – The arguments for editing a service.
  2. (Array): $data – The data used for editing a service
  •  Usage
  • This filter allows you to modify the arguments used when editing a service. You can use this filter to customize the arguments based on specific requirements, such as changing post titles or updating meta data
function custom_modify_edit_service_args($args, $data) {
    // Example modification: change the post title to uppercase
    $args['post_title'] = strtoupper($args['post_title']);
    return $args;
}
add_filter('gfb_edit_service_args', 'custom_modify_edit_service_args', 10, 2);

58.   Filter: gfb_add_service_args

  • Data Type
  • Array
  • Arguments
  1. (Array): $args – The arguments for adding a service.
  2. (Array): $data – The data used for adding a service.
  •  Usage
  • This filter allows you to modify the arguments used when adding a service. You can use this filter to customize the arguments based on specific requirements, such as changing post titles or updating meta data.
function custom_modify_add_service_args($args, $data) {
    // Example modification: change the post title to uppercase
    $args['post_title'] = strtoupper($args['post_title']);
    return $args;
}
add_filter('gfb_add_service_args', 'custom_modify_add_service_args', 10, 2);

7)File:class-gfb-setting.php

59.  Filter: gcal_synchronization_fields

  • Data Type
  • Array
  • Arguments
  1. (Array): $fields – The fields for synchronization.
  •  Usage
  • This filter allows you to modify the fields used for Google Calendar synchronization. You can use this filter to customize the fields based on specific requirements, such as adding new fields or changing existing ones.
function custom_modify_gcal_synchronization_fields($fields) {
    // Example modification: add a new field
    $fields['new_field'] = esc_html__('New Field', 'gfb');
    return $fields;
}
add_filter('gcal_synchronization_fields', 'custom_modify_gcal_synchronization_fields')

8)File:class-gfb-staff.php

60.   FiFilter: get_staffs_args

  • Data Type
  • Array
  • Arguments
  1. (Array): $args – The arguments for retrieving staff members.
  •  Usage
  • This filter allows you to modify the arguments used when retrieving staff members. You can use this filter to customize the arguments based on specific requirements, such as changing the post type or adding additional conditions to the query.
/**
 * Modify the arguments for retrieving staff members.
function custom_modify_get_staffs_args($args) {
    // Example modification: change the post type to 'custom-staff'
    $args['post_type'] = 'custom-staff';
    return $args;
}
add_filter('get_staffs_args', 'custom_modify_get_staffs_args');

61. Filter: gfb_add_staff_personal_details_notification

  • Data Type
  • Boolean
  • Arguments
  1.  (Boolean): $send_notification – Whether to send the notification for adding staff personal details.
  •  Usage
  • This filter allows you to control whether to send a notification when adding staff personal details. You can use this filter to customize the behavior based on specific requirements, such as always sending the notification or conditionally sending it.
function custom_modify_add_staff_personal_details_notification($send_notification) {
    // Example modification: always send the notification
    return true;
}
add_filter('gfb_add_staff_personal_details_notification', 'custom_modify_add_staff_personal_details_notification');

 62. Filter: gfb_add_staff_args

  • Data Type
  • Array
  • Arguments
  1.  (Array): $args – The arguments for adding a staff member.
  2. (Array): $data – The data used for adding a staff member.
  •  Usage
  • This filter allows you to modify the arguments used when adding a staff member. You can use this filter to customize the arguments based on specific requirements, such as changing the post type or updating meta data.
function custom_modify_add_staff_args($args, $data) {
    // Example modification: change the post type to 'custom-staff'
    $args['post_type'] = 'custom-staff';
    return $args;
}
add_filter('gfb_add_staff_args', 'custom_modify_add_staff_args', 10, 2);

9) File:woocommerce-gravity-form-addon.php-location.php

63.   Filter: gfb_entry_value_date_format

  • Data Type
  • String
  • Arguments
  1. (String): $value – The value to be formatted.
  •  Usage
  • This filter allows you to modify the date format of an entry value. You can use this filter to customize the date format based on specific requirements, such as changing the date format to match a particular standard or preference.
function custom_modify_entry_value_date_format($value) {
    // Example modification: change date format to YYYY-MM-DD
    return date('Y-m-d', strtotime($value));
}
add_filter('gfb_entry_value_date_format', 'custom_modify_entry_value_date_format');

64.  Filter: gfb_entry_value_time_format

  • Data Type
  • String
  • Arguments
  1. (String): $value – The value to be formatted.
  •  Usage
  • This filter allows you to modify the time format of an entry value. You can use this filter to customize the time format based on specific requirements, such as changing the time format to match a particular standard or preference.
function custom_modify_entry_value_time_format($value) {
    // Example modification: change time format to 24-hour format
    return date('H:i', strtotime($value));
}
add_filter('gfb_entry_value_time_format', 'custom_modify_entry_value_time_format');

10)File:class-gfb-appointment-calendar-field.php

65.   Filter: gfb_show_price_details

  • Data Type
  • Boolean
  • Arguments
  1.  (Boolean): $show_price_details – Whether to show price details.
  •  Usage
  • This filter allows you to control whether to show price details. You can use this filter to customize the behavior based on specific requirements, such as always showing price details or conditionally showing them.
function custom_modify_show_price_details($show_price_details) {
    // Example modification: always show price details
    return true;
}
add_filter('gfb_show_price_details', 'custom_modify_show_price_details');

66. Filter: gfb_get_value_merge_tag

  • Data Type
  • Mixed
  • Arguments
  1. (Mixed): $value – The value obtained from the merge tag.
  •  Usage
  • This filter allows you to modify the value obtained from a merge tag. You can use this filter to customize the value based on specific requirements, such as transforming it to uppercase, formatting it differently, or performing any other modifications.
function custom_modify_value_merge_tag($value) {
    // Example modification: uppercase the value
    if (is_string($value)) {
        return strtoupper($value);
    }
    return $value;
}
add_filter('gfb_get_value_merge_tag', 'custom_modify_value_merge_tag');

11)File:gfb-functions.php

67.  Filter: gfb_weeks_name

  • Data Type
  • Array
  • Arguments
  1.  (Array): $weeks – The names of the days of the week.
  2. (String): $type – The type of week.
  •  Usage
  • This filter allows you to modify the names of the days of the week. You can use this filter to customize the names based on specific requirements, such as adding prefixes or suffixes, translating them to different languages, or changing them according to the type of week.
function custom_modify_weeks_name($weeks, $type) {
    // Example modification: add "Work" prefix to each day's name
    foreach ($weeks as $day => $name) {
        $weeks[$day] = 'Work ' . $name;
    }
    return $weeks;
}
add_filter('gfb_weeks_name', 'custom_modify_weeks_name', 10, 2);

68. Filter: gfb_months_name

  • Data Type
  • Array
  • Arguments
  1. (Array): $months – The names of the months.
  2. (String): $type – The type of month
  •  Usage
  • This filter allows you to modify the names of the months. You can use this filter to customize the names based on specific requirements, such as adding prefixes or suffixes, translating them to different languages, or changing them according to the type of month.
function custom_modify_months_name($months, $type) {
    // Example modification: add "Month" suffix to each month's name
    foreach ($months as $month => $name) {
        $months[$month] = $name . ' Month';
    }
    return $months;
}
add_filter('gfb_months_name', 'custom_modify_months_name', 10, 2);

12)File:admin-calendar.php

69. Filter: gfb_calendar_title

  • Data Type
  • String
  • Arguments
  1. (String): $cal_title – The calendar title.
  •  Usage
  • (String): $cal_title – The calendar title.
function custom_modify_calendar_title($cal_title) {
    // Example modification: append " - Bookings" to the title
    return $cal_title . ' - Bookings';
}
add_filter('gfb_calendar_title', 'custom_modify_calendar_title');

13)File:calendar.php

70.  Filter: gfb_staff_timezone_on_calendar

  • Data Type
  • Boolean (True/False)
  • Arguments
  1. (Boolean): $display_timezone – Whether staff timezones should be displayed on the calendar.
  •  Usage
  • This filter allows you to control whether staff timezones are displayed on the calendar. By default, staff timezones are displayed if the filter returns true. You can use this filter to customize the behavior based on specific requirements, such as always displaying staff timezones or conditionally showing them.
function custom_display_staff_timezone_on_calendar($display_timezone) {
    // Example modification: always display staff timezones on the calendar
    return true;
}
add_filter('gfb_staff_timezone_on_calendar', 'custom_display_staff_timezone_on_calendar')

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

Filters

Or copy link

CONTENTS
Scroll to Top