> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/developers/actions/acpt_facetwp_display_value.md).

# acpt\_facetwp\_display\_value

Filters the display value FacetWP shows for a text-type ACPT field

**Type:** Filter

Part of the [FacetWP integration](/integrations/facetwp.md). Filters the human-readable display value FacetWP indexes/shows for an ACPT field that doesn't have a more specific formatter (i.e. any field type other than the built-in choice, relational, date, and toggle types, which are already formatted for you) — Text, Textarea, Number, and similar plain-value fields.

### Parameters

| Parameter | Type    | Description                                                                       |
| --------- | ------- | --------------------------------------------------------------------------------- |
| `$value`  | `mixed` | The raw field value about to be indexed/displayed                                 |
| `$params` | `array` | The FacetWP indexer row parameters (`post_id`, `facet_name`, `facet_value`, etc.) |

**Return:** `mixed` — the (optionally modified) display value.

### Usage

```php
add_filter("acpt_facetwp_display_value", function($value, array $params){
    // e.g. truncate a long text field for display in a facet
    return is_string($value) ? wp_trim_words($value, 10) : $value;
}, 10, 2);
```
