skunkcrm_SkunkCRM provides WordPress action and filter hooks to extend and customize your CRM. All hooks use the skunkcrm_ prefix.
Actions let you execute custom code at specific points in SkunkCRM's execution flow.
add_action('skunkcrm_after_contact_create',
'my_function', 10, 2);Filters let you modify data as it passes through SkunkCRM's processing.
add_filter('skunkcrm_contact_data_before_save',
'my_function', 10, 2);skunkcrm_activity_createdFires after an activity/note is created.
| Parameter | Type | Description |
|---|---|---|
$activity | object | The created activity object. |
$data | array | The data used to create the activity. |
add_action('skunkcrm_activity_created', function($activity, $data) {
// Your code here
}, 10, 2);skunkcrm_activity_deletedFires after an activity is deleted.
| Parameter | Type | Description |
|---|---|---|
$activity | object | The deleted activity object. |
add_action('skunkcrm_activity_deleted', function($activity) {
// Your code here
});skunkcrm_after_contact_archiveFires after a contact is successfully archived.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID that was archived |
$contact | array | Contact data |
add_action('skunkcrm_after_contact_archive', function($id, $contact) {
// Your code here
}, 10, 2);skunkcrm_after_contact_unarchiveFires after a contact is successfully unarchived.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID that was unarchived |
add_action('skunkcrm_after_contact_unarchive', function($id) {
// Your code here
});skunkcrm_before_contact_archiveFires before a contact is archived.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID being archived |
$contact | array | Contact data |
add_action('skunkcrm_before_contact_archive', function($id, $contact) {
// Your code here
}, 10, 2);skunkcrm_before_contact_unarchiveFires before a contact is unarchived.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID being unarchived |
add_action('skunkcrm_before_contact_unarchive', function($id) {
// Your code here
});skunkcrm_after_contact_assignment_changeFires after a contact's assignment is successfully changed.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID |
$old_assigned_to | int | Previous assignee user ID |
$new_assigned_to | int | New assignee user ID |
add_action('skunkcrm_after_contact_assignment_change', function($id, $old_assigned_to, $new_assigned_to) {
// Your code here
}, 10, 3);skunkcrm_before_contact_assignment_changeFires before a contact's assignment is changed.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID |
$old_assigned_to | int | Previous assignee user ID |
$new_assigned_to | int | New assignee user ID |
add_action('skunkcrm_before_contact_assignment_change', function($id, $old_assigned_to, $new_assigned_to) {
// Your code here
}, 10, 3);skunkcrm_after_contact_createFires after a contact is successfully created.
| Parameter | Type | Description |
|---|---|---|
$contact_id | int | Newly created contact ID |
$data | array | Contact data that was saved |
add_action('skunkcrm_after_contact_create', function($contact_id, $data) {
// Your code here
}, 10, 2);skunkcrm_after_contact_deleteFires after a contact is successfully deleted.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID that was deleted |
$contact | array | Contact data that was deleted |
add_action('skunkcrm_after_contact_delete', function($id, $contact) {
// Your code here
}, 10, 2);skunkcrm_after_contact_updateFires after a contact is successfully updated.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID that was updated |
$data | array | Contact data that was saved |
$existing_contact | array | Previous contact data |
add_action('skunkcrm_after_contact_update', function($id, $data, $existing_contact) {
// Your code here
}, 10, 3);skunkcrm_before_contact_createFires before a contact is created.
| Parameter | Type | Description |
|---|---|---|
$data | array | Contact data being created |
add_action('skunkcrm_before_contact_create', function($data) {
// Your code here
});skunkcrm_before_contact_deleteFires before a contact is deleted.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID being deleted |
$contact | array | Contact data being deleted |
add_action('skunkcrm_before_contact_delete', function($id, $contact) {
// Your code here
}, 10, 2);skunkcrm_before_contact_updateFires before a contact is updated.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID being updated |
$data | array | New contact data |
$existing_contact | array | Existing contact data |
add_action('skunkcrm_before_contact_update', function($id, $data, $existing_contact) {
// Your code here
}, 10, 3);skunkcrm_after_contacts_retrieveFires after contacts have been retrieved from the database.
| Parameter | Type | Description |
|---|---|---|
$results | array | Retrieved contact records |
$args | array | Query arguments used |
add_action('skunkcrm_after_contacts_retrieve', function($results, $args) {
// Your code here
}, 10, 2);skunkcrm_before_contacts_retrieveFires before contacts are retrieved from the database.
| Parameter | Type | Description |
|---|---|---|
$args | array | Query arguments being used |
add_action('skunkcrm_before_contacts_retrieve', function($args) {
// Your code here
});skunkcrm_contact_data_before_saveFilters contact data before saving to database during creation.
| Parameter | Type | Description |
|---|---|---|
$data | array | Contact data to be saved |
$contact_id | int|null | Contact ID (null for new contacts) |
add_filter('skunkcrm_contact_data_before_save', function($data, $contact_id) {
// Modify and return $data
return $data;
}, 10, 2);skunkcrm_contact_data_retrievedFilters contact data when retrieved by ID.
| Parameter | Type | Description |
|---|---|---|
$contact | array | Contact data |
$id | int | Contact ID |
add_filter('skunkcrm_contact_data_retrieved', function($contact, $id) {
// Modify and return $contact
return $contact;
}, 10, 2);skunkcrm_contacts_query_argsFilters the query arguments before retrieving contacts.
| Parameter | Type | Description |
|---|---|---|
$args | array | Query arguments |
add_filter('skunkcrm_contacts_query_args', function($args) {
// Modify and return $args
return $args;
});skunkcrm_contacts_route_configFilter the contacts endpoint route configuration.
| Parameter | Type | Description |
|---|---|---|
$contacts_route_config | array | The route configuration for contacts endpoints. |
add_filter('skunkcrm_contacts_route_config', function($contacts_route_config) {
// Modify and return $contacts_route_config
return $contacts_route_config;
});skunkcrm_contacts_search_resultsFilters the contacts search results before returning.
| Parameter | Type | Description |
|---|---|---|
$results | array | Array of contact records |
$args | array | Query arguments used |
add_filter('skunkcrm_contacts_search_results', function($results, $args) {
// Modify and return $results
return $results;
}, 10, 2);skunkcrm_get_contacts_paramsFilter get contacts request parameters.
| Parameter | Type | Description |
|---|---|---|
$params | array | Request parameters. |
$request | WP_REST_Request | Request object. |
add_filter('skunkcrm_get_contacts_params', function($params, $request) {
// Modify and return $params
return $params;
}, 10, 2);skunkcrm_after_contact_status_changeFires after a contact's status is successfully changed.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID |
$old_status | string | Previous status |
$new_status | string | New status |
add_action('skunkcrm_after_contact_status_change', function($id, $old_status, $new_status) {
// Your code here
}, 10, 3);skunkcrm_before_contact_status_changeFires before a contact's status is changed.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID |
$old_status | string | Previous status |
$new_status | string | New status |
add_action('skunkcrm_before_contact_status_change', function($id, $old_status, $new_status) {
// Your code here
}, 10, 3);skunkcrm_contact_status_optionsFilters the contact status options.
add_filter('skunkcrm_contact_status_options', function() {
// Modify and return $value
return $value;
});skunkcrm_deal_createdFires after a deal is created.
| Parameter | Type | Description |
|---|---|---|
$deal | object | The created deal object. |
$data | array | The data used to create the deal. |
add_action('skunkcrm_deal_created', function($deal, $data) {
// Your code here
}, 10, 2);skunkcrm_deal_updatedFires after a deal is updated.
| Parameter | Type | Description |
|---|---|---|
$updated_deal | object | The updated deal object. |
$existing_deal | object | The deal data before update. |
$data | array | The data that was updated. |
add_action('skunkcrm_deal_updated', function($updated_deal, $existing_deal, $data) {
// Your code here
}, 10, 3);skunkcrm_after_column_additionFires after adding deal_id column to activities table
| Parameter | Type | Description |
|---|---|---|
$activities_table | string | The activities table name |
$column_name | string | The column that was added |
add_action('skunkcrm_after_column_addition', function($activities_table, $column_name) {
// Your code here
}, 10, 2);skunkcrm_after_contact_retrieve_by_idFires after a contact is retrieved by ID.
| Parameter | Type | Description |
|---|---|---|
$contact | array|null | Contact data or null if not found |
$id | int | Contact ID that was retrieved |
add_action('skunkcrm_after_contact_retrieve_by_id', function($contact, $id) {
// Your code here
}, 10, 2);skunkcrm_after_create_contactFires after successfully creating a contact.
| Parameter | Type | Description |
|---|---|---|
$contact | array | Created contact data. |
$request | WP_REST_Request | Request object. |
add_action('skunkcrm_after_create_contact', function($contact, $request) {
// Your code here
}, 10, 2);skunkcrm_after_database_checkFires after database check.
add_action('skunkcrm_after_database_check', function() {
// Your code here
});skunkcrm_after_database_setupFires after database setup.
add_action('skunkcrm_after_database_setup', function() {
// Your code here
});skunkcrm_after_delete_contactFires after successfully deleting a contact.
| Parameter | Type | Description |
|---|---|---|
$contact | array | Deleted contact data. |
$request | WP_REST_Request | Request object. |
add_action('skunkcrm_after_delete_contact', function($contact, $request) {
// Your code here
}, 10, 2);skunkcrm_after_includes_loadedFires after includes loaded.
add_action('skunkcrm_after_includes_loaded', function() {
// Your code here
});skunkcrm_after_schema_updateFires after database schema updates complete
| Parameter | Type | Description |
|---|---|---|
$activities_table | string | The activities table name |
add_action('skunkcrm_after_schema_update', function($activities_table) {
// Your code here
});skunkcrm_after_table_dropFires after each individual table is dropped
| Parameter | Type | Description |
|---|---|---|
$table | string | The table name that was dropped |
add_action('skunkcrm_after_table_drop', function($table) {
// Your code here
});skunkcrm_after_table_recreationFires after all tables have been recreated
| Parameter | Type | Description |
|---|---|---|
$tables | array | Array of table names that were recreated |
add_action('skunkcrm_after_table_recreation', function($tables) {
// Your code here
});skunkcrm_after_tables_droppedFires after all tables are dropped but before recreation
| Parameter | Type | Description |
|---|---|---|
$tables | array | Array of table names that were dropped |
add_action('skunkcrm_after_tables_dropped', function($tables) {
// Your code here
});skunkcrm_after_update_contactFires after successfully updating a contact.
| Parameter | Type | Description |
|---|---|---|
$contact | array | Updated contact data. |
$request | WP_REST_Request | Request object. |
add_action('skunkcrm_after_update_contact', function($contact, $request) {
// Your code here
}, 10, 2);skunkcrm_before_column_additionFires before adding deal_id column to activities table
| Parameter | Type | Description |
|---|---|---|
$activities_table | string | The activities table name |
$columns | array | Current table columns |
add_action('skunkcrm_before_column_addition', function($activities_table, $columns) {
// Your code here
}, 10, 2);skunkcrm_before_contact_retrieve_by_idFires before a contact is retrieved by ID.
| Parameter | Type | Description |
|---|---|---|
$id | int | Contact ID being retrieved |
add_action('skunkcrm_before_contact_retrieve_by_id', function($id) {
// Your code here
});skunkcrm_before_create_contactFilter contact data before creating.
| Parameter | Type | Description |
|---|---|---|
$data | array | Contact data to create. |
$request | WP_REST_Request | Request object. |
add_filter('skunkcrm_before_create_contact', function($data, $request) {
// Modify and return $data
return $data;
}, 10, 2);skunkcrm_before_delete_contactFires before deleting a contact.
| Parameter | Type | Description |
|---|---|---|
$contact | array | Contact data being deleted. |
$request | WP_REST_Request | Request object. |
add_action('skunkcrm_before_delete_contact', function($contact, $request) {
// Your code here
}, 10, 2);skunkcrm_before_schema_updateFires before database schema updates begin
| Parameter | Type | Description |
|---|---|---|
$activities_table | string | The activities table name |
add_action('skunkcrm_before_schema_update', function($activities_table) {
// Your code here
});skunkcrm_before_table_dropFires before each individual table is dropped
| Parameter | Type | Description |
|---|---|---|
$table | string | The table name being dropped |
add_action('skunkcrm_before_table_drop', function($table) {
// Your code here
});skunkcrm_before_table_recreationFires before tables are dropped for recreation
| Parameter | Type | Description |
|---|---|---|
$tables | array | Array of table names to be dropped |
add_action('skunkcrm_before_table_recreation', function($tables) {
// Your code here
});skunkcrm_calendar_contentFires calendar content.
add_action('skunkcrm_calendar_content', function() {
// Your code here
});skunkcrm_contact_auto_assignedFires contact auto assigned.
add_action('skunkcrm_contact_auto_assigned', function() {
// Your code here
});skunkcrm_contact_validation_rulesFilters contact validation rules before creation.
| Parameter | Type | Description |
|---|---|---|
$validation_rules | array | Array of validation rules |
$data | array | Contact data being validated |
add_filter('skunkcrm_contact_validation_rules', function($validation_rules, $data) {
// Modify and return $validation_rules
return $validation_rules;
}, 10, 2);skunkcrm_email_receivedFires email received.
add_action('skunkcrm_email_received', function() {
// Your code here
});skunkcrm_enqueue_pro_spa_scriptsFires enqueue pro spa scripts.
add_action('skunkcrm_enqueue_pro_spa_scripts', function() {
// Your code here
});skunkcrm_import_dealsAction hook for pro plugin to handle deals import
add_filter('skunkcrm_import_deals', function() {
// Modify and return $value
return $value;
});skunkcrm_import_teamAction hook for pro plugin to handle team import
add_filter('skunkcrm_import_team', function() {
// Modify and return $value
return $value;
});skunkcrm_import_typesFilters the import types.
add_filter('skunkcrm_import_types', function() {
// Modify and return $value
return $value;
});skunkcrm_individual_contact_route_configFilter the individual contact endpoint route configuration.
| Parameter | Type | Description |
|---|---|---|
$individual_contact_config | array | The route configuration for individual contact endpoints. |
add_filter('skunkcrm_individual_contact_route_config', function($individual_contact_config) {
// Modify and return $individual_contact_config
return $individual_contact_config;
});skunkcrm_legacy_table_droppedFires legacy table dropped.
add_action('skunkcrm_legacy_table_dropped', function() {
// Your code here
});skunkcrm_recreate_tables_listFilter the list of tables to be recreated
| Parameter | Type | Description |
|---|---|---|
$tables | array | Array of table names to be dropped and recreated |
add_filter('skunkcrm_recreate_tables_list', function($tables) {
// Modify and return $tables
return $tables;
});skunkcrm_table_createdFires table created.
add_action('skunkcrm_table_created', function() {
// Your code here
});skunkcrm_tour_completedFires when user completes or skips the product tour.
| Parameter | Type | Description |
|---|---|---|
$user_id | int | User ID. |
$status | string | Tour status ('completed' or 'skipped'). |
add_action('skunkcrm_tour_completed', function($user_id, $status) {
// Your code here
}, 10, 2);skunkcrm_tour_resetFires when user resets the product tour.
| Parameter | Type | Description |
|---|---|---|
$user_id | int | User ID. |
add_action('skunkcrm_tour_reset', function($user_id) {
// Your code here
});skunkcrm_admin_permission_checkFilter admin API permissions check result.
| Parameter | Type | Description |
|---|---|---|
$has_admin_permission | bool | Whether user has admin permission. |
add_filter('skunkcrm_admin_permission_check', function($has_admin_permission) {
// Modify and return $has_admin_permission
return $has_admin_permission;
});skunkcrm_after_admin_permission_checkFires after checking admin API permissions.
| Parameter | Type | Description |
|---|---|---|
$has_admin_permission | bool | Whether user has admin permission. |
add_action('skunkcrm_after_admin_permission_check', function($has_admin_permission) {
// Your code here
});skunkcrm_after_permission_checkFires after checking basic API permissions.
| Parameter | Type | Description |
|---|---|---|
$has_permission | bool | Whether user has permission. |
add_action('skunkcrm_after_permission_check', function($has_permission) {
// Your code here
});skunkcrm_after_team_permission_checkFires after checking team API permissions.
| Parameter | Type | Description |
|---|---|---|
$has_team_permission | bool | Whether user has team permission. |
add_action('skunkcrm_after_team_permission_check', function($has_team_permission) {
// Your code here
});skunkcrm_before_admin_permission_checkFires before checking admin API permissions.
add_action('skunkcrm_before_admin_permission_check', function() {
// Your code here
});skunkcrm_before_permission_checkFires before checking basic API permissions.
add_action('skunkcrm_before_permission_check', function() {
// Your code here
});skunkcrm_before_team_permission_checkFires before checking team API permissions.
add_action('skunkcrm_before_team_permission_check', function() {
// Your code here
});skunkcrm_team_permission_checkFilter team API permissions check result.
| Parameter | Type | Description |
|---|---|---|
$has_team_permission | bool | Whether user has team permission. |
add_filter('skunkcrm_team_permission_check', function($has_team_permission) {
// Modify and return $has_team_permission
return $has_team_permission;
});skunkcrm_after_activationFires after activation.
add_action('skunkcrm_after_activation', function() {
// Your code here
});skunkcrm_after_api_initFires after SkunkCRM REST API routes are registered.
| Parameter | Type | Description |
|---|---|---|
$api_instance | SkunkCRM_API | The API instance. |
add_action('skunkcrm_after_api_init', function($api_instance) {
// Your code here
});skunkcrm_after_deactivationFires after deactivation.
add_action('skunkcrm_after_deactivation', function() {
// Your code here
});skunkcrm_after_initFires after init.
add_action('skunkcrm_after_init', function() {
// Your code here
});skunkcrm_after_user_roles_initFires after user roles init.
add_action('skunkcrm_after_user_roles_init', function() {
// Your code here
});skunkcrm_before_api_initFires before SkunkCRM REST API routes are registered.
| Parameter | Type | Description |
|---|---|---|
$api_instance | SkunkCRM_API | The API instance. |
add_action('skunkcrm_before_api_init', function($api_instance) {
// Your code here
});skunkcrm_before_deactivationFires before deactivation.
add_action('skunkcrm_before_deactivation', function() {
// Your code here
});skunkcrm_before_initFires before init.
add_action('skunkcrm_before_init', function() {
// Your code here
});skunkcrm_apply_rate_limitingFilters the apply rate limiting.
add_filter('skunkcrm_apply_rate_limiting', function() {
// Modify and return $value
return $value;
});skunkcrm_after_api_requestFires after processing create contact API request successfully.
| Parameter | Type | Description |
|---|---|---|
$response | WP_REST_Response | Response object. |
$request | WP_REST_Request | Request object. |
$endpoint | string | Current endpoint name. |
add_action('skunkcrm_after_api_request', function($response, $request, $endpoint) {
// Your code here
}, 10, 3);skunkcrm_api_errorFires when create contact API request encounters an error.
| Parameter | Type | Description |
|---|---|---|
$error | WP_Error | Error object. |
$request | WP_REST_Request | Request object. |
$endpoint | string | Current endpoint name. |
add_action('skunkcrm_api_error', function($error, $request, $endpoint) {
// Your code here
}, 10, 3);skunkcrm_api_error_responseFilter API error before returning.
| Parameter | Type | Description |
|---|---|---|
$error | WP_Error | Error object. |
$exception | Exception | Original exception. |
$request | WP_REST_Request | Request object. |
$endpoint | string | Current endpoint name. |
add_filter('skunkcrm_api_error_response', function($error, $exception, $request, $endpoint) {
// Modify and return $error
return $error;
}, 10, 4);skunkcrm_api_permission_checkFilter basic API permissions check result.
| Parameter | Type | Description |
|---|---|---|
$has_permission | bool | Whether user has permission. |
add_filter('skunkcrm_api_permission_check', function($has_permission) {
// Modify and return $has_permission
return $has_permission;
});skunkcrm_api_rate_limitedFires when API request is rate limited.
| Parameter | Type | Description |
|---|---|---|
$endpoint | string | Current endpoint name. |
$current_requests | int | Number of current requests. |
$rate_config | array | Rate limit configuration. |
add_action('skunkcrm_api_rate_limited', function($endpoint, $current_requests, $rate_config) {
// Your code here
}, 10, 3);skunkcrm_api_rate_limitsFilters the api rate limits.
add_filter('skunkcrm_api_rate_limits', function() {
// Modify and return $value
return $value;
});skunkcrm_api_responseFilter create contact response before sending.
| Parameter | Type | Description |
|---|---|---|
$response | WP_REST_Response | Response object. |
$request | WP_REST_Request | Request object. |
$endpoint | string | Current endpoint name. |
add_filter('skunkcrm_api_response', function($response, $request, $endpoint) {
// Modify and return $response
return $response;
}, 10, 3);skunkcrm_api_response_dataFilter delete contact response data before creating response.
| Parameter | Type | Description |
|---|---|---|
$response_data | array | Response data. |
$request | WP_REST_Request | Request object. |
$endpoint | string | Current endpoint name. |
add_filter('skunkcrm_api_response_data', function($response_data, $request, $endpoint) {
// Modify and return $response_data
return $response_data;
}, 10, 3);skunkcrm_before_api_requestFires before processing create contact API request.
| Parameter | Type | Description |
|---|---|---|
$request | WP_REST_Request | Request object. |
$endpoint | string | Current endpoint name. |
add_action('skunkcrm_before_api_request', function($request, $endpoint) {
// Your code here
}, 10, 2);skunkcrm_before_task_deleteFires before task delete.
add_action('skunkcrm_before_task_delete', function() {
// Your code here
});skunkcrm_task_completedFires task completed.
add_action('skunkcrm_task_completed', function() {
// Your code here
});skunkcrm_task_createdFires task created.
add_action('skunkcrm_task_created', function() {
// Your code here
});skunkcrm_task_updatedFires task updated.
add_action('skunkcrm_task_updated', function() {
// Your code here
});Documentation auto-generated from plugin source code. Last updated: 1/23/2026