For the complete documentation index, see llms.txt. This page is also available as Markdown.

acpt_facetwp_display_value

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

Type: Filter

Part of the FacetWP integration. 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

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);

Last updated