# Contact Filters
Custom content for ' . $subscriber->email . '
' ]; return $widgets; }, 10, 2); ``` **Source:** `app/Http/Controllers/SubscriberController.php` --- ### `fluent_crm/subscriber_info_widgets` Filter additional sidebar info widgets on a contact profile page. **Parameters** - `$widgets` Array - Widget definitions - `$subscriber` [Subscriber Model](/database/models/subscriber) **Usage:** ```php add_filter('fluent_crm/subscriber_info_widgets', function($widgets, $subscriber) { $widgets[] = [ 'title' => 'Membership', 'content' => 'Gold Member
' ]; return $widgets; }, 10, 2); ``` **Source:** `app/Http/Controllers/SubscriberController.php` --- ### `fluent_crm/contact_note_fields` Filter the array of additional fields shown on the Add Note form for contacts. **Parameters** - `$fields` Array - Additional field definitions **Usage:** ```php add_filter('fluent_crm/contact_note_fields', function($fields) { $fields[] = [ 'key' => 'priority', 'label' => __('Priority', 'fluent-crm'), 'type' => 'select', 'options' => ['low' => 'Low', 'medium' => 'Medium', 'high' => 'High'] ]; return $fields; }); ``` **Source:** `app/Services/Helper.php` --- ## Custom Fields & Avatars ### `fluent_crm/global_field_types` Filter the list of available custom contact field types (text, date, checkbox, etc.). **Parameters** - `$fieldTypes` Array - Field type definitions **Usage:** ```php add_filter('fluent_crm/global_field_types', function($fieldTypes) { $fieldTypes['color_picker'] = [ 'label' => 'Color Picker', 'type' => 'color_picker' ]; return $fieldTypes; }); ``` **Source:** `app/Models/CustomContactField.php` --- ### `fluent_crm/modify_custom_field_value` Filter a custom field value when it is retrieved. Useful for transforming stored values before display. **Parameters** - `$value` Mixed - The custom field value **Usage:** ```php add_filter('fluent_crm/modify_custom_field_value', function($value) { // Transform the value as needed return $value; }); ``` **Source:** `app/Models/Subscriber.php` --- ### `fluent_crm/default_avatar` Filter the default avatar URL used when Gravatar is disabled or no avatar is available. **Parameters** - `$url` String - Default avatar image URL - `$email` String - Contact's email address **Usage:** ```php add_filter('fluent_crm/default_avatar', function($url, $email) { return 'https://example.com/custom-avatar.png'; }, 10, 2); ``` **Source:** `app/Functions/helpers.php` --- ### `fluent_crm/get_avatar` Filter the final avatar URL for a contact (Gravatar or custom). **Parameters** - `$url` String - Avatar URL (Gravatar by default) - `$email` String - Contact's email address **Usage:** ```php add_filter('fluent_crm/get_avatar', function($url, $email) { // Use a custom avatar service return 'https://avatars.example.com/' . md5($email); }, 10, 2); ``` **Source:** `app/Functions/helpers.php` --- ### `fluent_crm/allowed_html_tags` Filter the array of allowed HTML tags and attributes used in `wp_kses()` for sanitizing content. **Parameters** - `$tags` Array - Associative array of tag => attributes **Usage:** ```php add_filter('fluent_crm/allowed_html_tags', function($tags) { $tags['iframe'] = [ 'src' => true, 'width' => true, 'height' => true ]; return $tags; }); ``` **Source:** `app/Services/Helper.php` --- ## Smart Codes ### `fluentcrm_contact_smartcodes` Filter the array of contact smart codes (e.g., `contact.first_name`, `contact.email`) shown in the smart code picker. **Parameters** - `$smartCodes` Array - Array of smart code definitions **Usage:** ```php add_filter('fluentcrm_contact_smartcodes', function($smartCodes) { $smartCodes[] = [ 'key' => '{{contact.custom_field}}', 'title' => 'Custom Field' ]; return $smartCodes; }); ``` **Source:** `app/Services/Helper.php` --- ### `fluent_crm/general_smartcodes` Filter the array of general CRM and WordPress smart codes (e.g., `crm.business_name`, `wp.admin_email`). **Parameters** - `$smartCodes` Array - Array of general smart code definitions **Usage:** ```php add_filter('fluent_crm/general_smartcodes', function($smartCodes) { $smartCodes[] = [ 'key' => '{{crm.site_phone}}', 'title' => 'Site Phone Number' ]; return $smartCodes; }); ``` **Source:** `app/Services/Helper.php` --- ### `fluent_crm/smartcode_groups` Filter the full grouped array of smart code groups returned by `getGlobalSmartCodes()`. **Parameters** - `$smartCodes` Array - Grouped smart code array **Usage:** ```php add_filter('fluent_crm/smartcode_groups', function($smartCodes) { // Add a custom smart code group $smartCodes['my_group'] = [ 'title' => 'My Custom Codes', 'shortcodes' => [ '{{my_group.key1}}' => 'Description 1' ] ]; return $smartCodes; }); ``` **Source:** `app/Services/Helper.php` --- ### `fluent_crm/extended_smart_codes` Filter the array of additional smart code groups registered by add-ons. **Parameters** - `$extendedCodes` Array - Default `[]` **Usage:** ```php add_filter('fluent_crm/extended_smart_codes', function($codes) { $codes[] = [ 'title' => 'WooCommerce', 'shortcodes' => [ '{{woo.last_order_total}}' => 'Last Order Total' ] ]; return $codes; }); ``` **Source:** `app/Services/Helper.php` --- ## Bulk Actions & Filters ### `fluent_crm/custom_contact_bulk_actions` Add custom bulk actions to the contacts table dropdown. **Parameters** - `$actions` Array - Default `[]` **Usage:** ```php add_filter('fluent_crm/custom_contact_bulk_actions', function($actions) { $actions[] = [ 'label' => __('Sync to External', 'fluent-crm'), 'value' => 'sync_external' ]; return $actions; }); ``` > **Tip:** Handle the action via the `fluent_crm/contact_bulk_action_{$actionName}` dynamic filter. **Source:** `app/Hooks/Handlers/AdminMenu.php` --- ### `fluent_crm/contact_bulk_action_limit` Filter the maximum number of contacts to process in a single bulk-action request. **Parameters** - `$limit` INT - Default `400` - `$request` Request Object **Usage:** ```php add_filter('fluent_crm/contact_bulk_action_limit', function($limit, $request) { return 1000; }, 10, 2); ``` **Source:** `app/Http/Controllers/SubscriberController.php` --- ### `fluentcrm_advanced_filter_options` Filter the full array of advanced filter groups for the contact filter UI. **Parameters** - `$groups` Array - Filter group definitions **Usage:** ```php add_filter('fluentcrm_advanced_filter_options', function($groups) { // Add a custom filter group $groups['my_filters'] = [ 'label' => 'My Custom Filters', 'options' => [ ['label' => 'Has Purchased', 'value' => 'has_purchased'] ] ]; return $groups; }); ``` **Source:** `app/Services/Helper.php` --- ## CSV Export & Import Mapping ### `fluent_crm/subscriber_table_columns` Filter the column definitions for CSV export of the Contacts table. **Parameters** - `$columns` Array - Column definitions **Usage:** ```php add_filter('fluent_crm/subscriber_table_columns', function($columns) { $columns['custom_field'] = __('Custom Field', 'fluent-crm'); return $columns; }); ``` **Source:** `app/Http/Controllers/CsvController.php` --- ### `fluentcrm_user_map_data` Filter the [Subscriber](/database/models/subscriber) data array when mapping a WordPress user to a CRM contact during sync. **Parameters** - `$subscriber` Array - Subscriber data being mapped - `$user` \WP_User - WordPress user object **Usage:** ```php add_filter('fluentcrm_user_map_data', function($subscriber, $user) { $subscriber['company_id'] = get_user_meta($user->ID, 'company_id', true); return $subscriber; }, 10, 2); ``` **Source:** `app/Services/Helper.php` --- ### `fluentcrm_update_wp_user_email_on_change` Control whether the linked WordPress user's email should be updated when the CRM contact's email changes. **Parameters** - `$update` Boolean - Default `false` **Usage:** ```php add_filter('fluentcrm_update_wp_user_email_on_change', function($update) { return true; // Sync email changes to WP user }); ``` **Source:** `app/Models/Subscriber.php`