Taxonomy advanced returns term id as string in in group loop

Support Meta Box AIO Taxonomy advanced returns term id as string in in group loopResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #39385

    Hi , i am retrieving my taxonomy advanced term id in group
    $categoryUrl = $item['sample'] ?? '';
    , but it returns as string NOT as int().
    I was able to get term url afterwards using
    $linkCat = get_term_link( (int)$categoryUrl, '' );
    But there is no mentioning of this in documentation and got me confused.
    So please either add explanation of this behaviour or explain to my why did it happen ?

    Much appreciated.

    #39396
    PeterPeter
    Moderator

    Hello,

    If you take a closer look in the database, table wp_postmeta, you can see the group field value save the data in a serialized string and of course, the output value is a string. MB Group uses this PHP function to serialize an array of subfield values https://www.php.net/manual/en/function.serialize.php

    You can add the (int) to set the type of data to integer as well. Thanks.

    #39398

    Okay thanks , would be great that you would add it this information of behaviour to "advanced taxonomy" documentation as i have had multiple obstacles when working with grouped options and there is rarely any info on it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.