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

Actions

Estimated reading: 4 minutes 84 views

1. Action: gfb_after_menu_register

  • Data Type
  • None
  • Arguments
  • None
  • Usage
  • This action allows you to execute custom functionality after menu registration. You can use this action to perform tasks such as additional menu setup, initialization of menu-related components, or displaying messages to users after menu registration.
function gfb_after_menu_register_callback() {
	add_submenu_page(
        'gfb',
        __( 'Books Shortcode Reference', 'textdomain' ),
        __( 'Shortcode Reference', 'textdomain' ),
        'manage_options',    //this is for the first one
        'books-shortcode-ref',
        'books_ref_page_callback'
    );
}
add_action('gfb_after_menu_register', 'gfb_after_menu_register_callback');

2. Action: gfb_created_appointment

  • Data Type
  • Integer: $appointment_id – The ID of the created appointment.
  •  Arguments
  • (Integer): $appointment_id – The ID of the create appointment.
  • Usage
  • This action allows you to execute custom functionality after an appointment is created. You can use this action to perform tasks such as logging information about the created appointment, sending notifications, or triggering further processing based on the appointment details.
function custom_created_appointment_action($appointment_id) {
    // Example action: log the created appointment ID
    update_post_meta( $appointment_id, 'status', 'confirmed' );
    // You can perform additional actions here based on the created appointment
}
add_action('gfb_created_appointment', 'custom_created_appointment_action', 10, 1)

3. Action: gfb_before_settings_menu

  • Data Type
  • None
  • Arguments
  • None
  • Usage
  • This action allows you to execute custom functionality before the settings menu is displayed. You can use this action to perform tasks such as modifying settings, loading additional resources, or executing specific actions required before rendering the settings menu.
/**
 * Execute custom functionality before the settings menu is displayed.
 */
function custom_before_settings_menu_action() {
    // Example action: perform tasks before the settings menu is displayed
    // You can add your custom code here
}
add_action('gfb_before_settings_menu', 'custom_before_settings_menu_action');

4. Action: gfb_booking_appointment_validate_before

  •  Data Type
  • Mixed: $value – The value to be validated.
  • Array: $form – The form data.
  • Object: $instance – The instance of the booking class.
  • Arguments
  1. (Mixed): $value – The value to be validated.
  2. (Array): $form – The form data.
  3. (Object): $instance – The instance of the booking class.
  • Usage
  • This action allows you to perform custom actions after validating a booking appointment. You can use this action to execute tasks based on the validated value, form data, or booking instance.
function custom_booking_appointment_validation_after($value, $form, $instance) {
    // Example: Perform custom actions after validation
    // This action runs after the booking appointment validation is completed
}
add_action('gfb_booking_appointment_validate_after', 'custom_booking_appointment_validation_after', 10, 3);

5. Action: gfb_booking_appointment_validate_after

  •  Data Type
  • Mixed: $value – The value to be validated.
  • Array: $form – The form data.
  • Object: $instance – The instance of the booking class.
  • Arguments
  1. (Mixed): $value – The value to be validated.
  2. (Array): $form – The form data.
  3. (Object): $instance – The instance of the booking class.
  • Usage
  • This action allows you to perform custom actions after validating a booking appointment. You can use this action to execute tasks based on the validated value, form data, or booking instance.
function custom_booking_appointment_validation_after($value, $form, $instance) {
    // Example: Perform custom actions after validation
    // This action runs after the booking appointment validation is completed
}
add_action('gfb_booking_appointment_validate_after', 'custom_booking_appointment_validation_after', 10, 3);

6. Action: gfb_get_value_merge_tag

  • Data Type
  • Mixed: $value – The merge tag value.
  •  Arguments
  1. (Mixed): $value – The merge tag value.
  • Usage
  • This action allows you to perform custom actions when retrieving merge tag values.
function custom_get_value_merge_tag_action($value) {
    // Example: Perform custom actions when retrieving merge tag values
}
add_action('gfb_get_value_merge_tag', 'custom_get_value_merge_tag_action', 10, 1);

7. Action: gfb_email_template_frontend

  •  Data Type
  • Integer: $appointment_id – The appointment ID.
  • Integer: $template_id – The template ID.
  • Arguments
  1.  (Integer): $appointment_id – The appointment ID.
  2. (Integer): $template_id – The template ID.
  • Usage
  • This action allows you to perform custom actions when rendering email templates on the frontend.
function custom_email_template_frontend_action($appointment_id, $template_id) {
    // Example: Perform custom actions when rendering email templates on the frontend
}
add_action('gfb_email_template_frontend', 'custom_email_template_frontend_action', 10, 2);

Leave a Reply

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

Share this Doc

Actions

Or copy link

CONTENTS
Scroll to Top