[Resolved] Get Repeatable Group from Parent set by WordPress hierarchical relationship:

This thread is resolved. Here is a description of the problem and solution.


I have the following structure in a CTP "Ratgeber" set by WordPress hierarchical relationship, how can I get the top tier parent "Ratgeber" post ID?


It needs custom codes, to find out the top level(parent) "Ratgeber" post ID, please check similar thread: https://wordpress.stackexchange.com/questions/315799/get-top-parent-url

Relevant Documentation:

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by hendrikH 1 month, 2 weeks ago.

Assigned support staff: Luo Yang.


Hello Toolset Support,

Currently, I am using Toolset Repeatable Group with a "number" field to retrieve information via an API.
I have used the following code to retrieve the values of the fields into an array.

    $section_ids = toolset_get_related_posts(
    $new_pzn = array();
    if ( $section_ids ){
    foreach ( $section_ids as $section_id ){
        $section = get_post_meta( $section_id, '', false );
        $section_content = $section["wpcf-pznnumber-ratgeber"][0];
        array_push($new_pzn, $section_content);
    if ( $new_pzn ){
        foreach ( $new_pzn as $single_new_pzn ){
            [... API stuff..]

I have the following structure in a CTP "Ratgeber" set by WordPress hierarchical relationship:
supplements - parent
vitamins - child of supplements
vitamin d - child of vitamins
vitamin d deficiency - child of vitamin d

My question is: How can I get the values of the repeatable group from the top tier parent to all subsequent children.
"supplements" - has repeatable group fields filled and I want "vitamins", "vitamin d", "vitamin d deficiency" to have access to those values if their fields are not filled.

Thank you very much.


Luo Yang

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)


It needs custom codes, for example:
In a single "Ratgeber" post:
1) find out the top level(parent) "Ratgeber" post ID, see similar thread:

2) Then use above "Ratgeber" post ID to replace "get_the_ID()" of the PHP codes you mentioned above.

More help:


My issue is resolved now. Thank you!