Support

Account

Home Forums ACF PRO Get Relationship for Tab and Title

Solving

Get Relationship for Tab and Title

  • Hello,

    Great app so far. But I am looking to add a filter that includes the “title” value into the “tab” name value.

    TO do that I need the relationship between the tab and all its children.

    How can I find this relationship ?

  • There is no relationship between tabs and the fields that appear in them. Tab fields are purely for admin layout and the hiding/showing of fields in a tab is done completely through JavaScript and CSS. Anything between one tab field and the next tab field are “in the tab”.

  • If that’s the case, how does the admin layout figure out that anything between one tab field and the next are “in the tab”?

  • That is all done with JavaScript. In ACF Pro if you look in the file /plugins/advanced-custom-fields-pro/assets/js/acf-input.js there is a function starting on about line 7164.

    Basically, from what I understand it looks for a tab field and then looks for the next tab field, checking for end points along the way, and hides or shows fields based on that. It adds several classes to the fields so it knows where the first field in the tab is and where, etc. The hiding and showing is all done by adding or removing these classed from the field wrappers.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Get Relationship for Tab and Title’ is closed to new replies.