Skip to content

wpt_filter_truncated_value

github-actions[bot] edited this page Jun 14, 2026 · 1 revision

Filter a template tag value after truncation. If a value like an excerpt or post content has been truncated, you can modify the output using this filter.

Auto-generated Example

add_filter(
   'wpt_filter_truncated_value',
    function(
        string $new_value,
        string $key,
        string $old_value
    ) {
        // Your code here.
        return $new_value;
    },
    10,
    3
);

Parameters

  • string $new_value Text truncated to maximum allowed length.
  • string $key Template tag.
  • string $old_value Text prior to truncation.

Returns

string

Files

apply_filters( 'wpt_filter_truncated_value', $new_value, $key, $old_value )

← All Hooks

Clone this wiki locally