Comfort Job provides a variety of hooks and filters that allow developers to customize and extend the plugin's functionality. These hooks and filters can be used to modify the behavior of the plugin, add new features, or integrate with other plugins or themes.
Hooks
Hooks in Comfort Job are points in the code where developers can add custom functions or code to modify the plugin's behavior. There are two types of hooks in WordPress: action hooks and filter hooks.
Activation and Deactivation
- register_activation_hook(FILE, 'activate_comfortjob');
- register_deactivation_hook(FILE, 'deactivate_comfortjob');
ComfortJob Plugin
Action Hooks
comfortjob_job_single_start- Triggered at the start of the single job template.
- Parameters:
$job(array): The job data.
- Example:
comfortjob_job_single_end- Triggered at the end of the single job template.
- Parameters:
$job(array): The job data.
- Example:
comfortjob_job_details_before- Triggered before the job details are displayed.
- Parameters:
$job(array): The job data.
- Example:
comfortjob_job_details_after- Triggered after the job details are displayed.
- Parameters:
$job(array): The job data.
- Example:
comfortjob_job_published- Triggered when a job is published.
- Parameters:
$job_id(int): The ID of the published job.$status(string): The status of the job.$user_id(int): The ID of the user who published the job.$data(array): Additional data.
- Example:
Filter Hooks
comfortjob_settings_fields- Filters the settings fields for the plugin.
- Parameters:
$fields(array): The settings fields.
- Example:
comfortjob_js_translation- Filters the JavaScript translations for the plugin.
- Parameters:
$translations(array): Translations for JavaScript.
- Example:
comfortjob_single_job- Filters the single job data.
- Parameters:
$job(array): The job data.$job_id(int): The job ID.
- Example:
comfortjob_employer_dashboard_menus- Filters the employer dashboard menus.
- Parameters:
$menus(array): The dashboard menus.
- Example:
comfortjob_default_file_mimes- Filters the default file MIME types for uploads.
- Parameters:
$mimes(string): The default MIME types.
- Example:
ComfortJobPro Plugin
Action Hooks
comfortjob_company_delete_after- Triggered after a company is deleted.
- Parameters:
$company_id(int): The ID of the deleted company.$data(array): Additional data.
- Example:
comfortjob_wpheading_wrap_right_before- Triggered before the settings import/export button is added.
- Example:
comfortjob_settings_form_before- Triggered before the settings form is displayed.
- Example:
Filter Hooks
comfortjob_guest_login_forms- Filters the guest login forms.
- Parameters:
$forms(array): The login forms.
- Example:
comfortjob_max_job_per_user- Filters the maximum number of jobs a user can create.
- Parameters:
$max(int): Maximum number of jobs.$user_id(int): The user ID.
- Example:
comfortjob_rest_routes- Filters the REST API routes for the plugin.
- Parameters:
$routes(array): The REST API routes.
- Example:
comfortjob_login_html- Filters the login HTML for the plugin.
- Parameters:
$html(string): The login HTML.$args(array): Additional arguments.
- Example:
comfortjob_register_html- Filters the registration HTML for the plugin.
- Parameters:
$html(string): The registration HTML.$args(array): Additional arguments.
- Example:
This documentation provides an overview of the available hooks and filters in the ComfortJob and ComfortJobPro plugins. Use these to extend or customize the functionality as needed.
