aam_marker_typecast_filter
Purpose
Return a converted value for a custom cast type. Built-in casts are handled before this filter runs.
Callback
- Type: Filter.
- Arguments:
$value(mixed),$type(cast name). - Return: the filtered first argument.
Example
add_filter('aam_marker_typecast_filter', function ($value, $type) {
return $type === 'upper' ? strtoupper((string) $value) : $value;
}, 10, 2);
A marker using the custom upper cast becomes uppercase; all other custom cast requests retain their value.
See the complete hook list.