-
Notifications
You must be signed in to change notification settings - Fork 4
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.
add_filter(
'wpt_filter_truncated_value',
function(
string $new_value,
string $key,
string $old_value
) {
// Your code here.
return $new_value;
},
10,
3
);-
string$new_valueText truncated to maximum allowed length. -
string$keyTemplate tag. -
string$old_valueText prior to truncation.
string
apply_filters( 'wpt_filter_truncated_value', $new_value, $key, $old_value )