sage-directives icon indicating copy to clipboard operation
sage-directives copied to clipboard

Using @field with number as second parameter always returns the string case

Open erip2 opened this issue 3 years ago • 0 comments

I'm trying to get a field of a specific post, but when I use the directive like this @field('location', $element->ID) it returns the get_field function like this:

<?= get_field('location')[3205]; ?>

This happens because when Util::parse($expression); is used, it makes all the parameters to string and the check on line 68 is !is_string() when actually should be is_numeric().

erip2 avatar Mar 02 '22 13:03 erip2