• I have a Genus field that is a taxonomy type with return value set to default term ID. I am using Dynamic Content for Elementor plugin to display some posts of genera that I want sorted by that field. However, DCE is sorting by the term ID number, not the genus name. Does changing term to Term object return the field’s genus name instead of a number?

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    The ACF “Return Format” logic is used when get_field('my_field', 123, true) is casted. The last argument true tells ACF to use the “Return Format” defined in the Field UI. See get_field() documentation.

    I don’t know how Dynamic Content for Elementor retrieve/display values, but in all cases, changing the “Return Format” should not change the order of the values. Values are display in the order they were saved in the first place.

    If you want to change values order, you can use the native acf/load_value hook (see documentation). This hook is applied right after the value is loaded from database and before it is formatted by the “Return Format”. You’ll have terms ids here, but you can use these to reorder values by getting each terms names with get_term() (see documentation).

    If it doesn’t work, then I would recommend to get in touch with the Elementor support, they might have some custom logic themself.

    Hope it helps!

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Term Object and Term ID values’ is closed to new replies.