Support

Account

Forum Replies Created

  • Very nice! This worked great. Of course you can install without composer by adding this to your functions file.

    // Repeater unique ID in a folder called functions in my theme
    require_once(‘functions/ACF_Field_Unique_ID.php’);

    PhilipNewcomer\ACF_Unique_ID_Field\ACF_Field_Unique_ID::init();

  • Hi,

    I figured out that this is not possible.

    Repeater
    – Repeater
    – – Text Field
    – Repeater
    – – Select Field Loaded from Text Field Above

    The error was Trying to get property of non-object

    So I rethought the data and realized I dould get rid of one of the parent repeater went with this

    – Repeater
    – – Text Field (result_title)
    – Repeater
    – – Select Field Loaded from Text Field Above (yes_complete_target)

    The code then is

    add_filter('acf/load_field/name=yes_complete_target', 'acf_load_complete_field_choices');
    
    function acf_load_complete_field_choices($field){
    
        global $post;
    
        $post_id = $post->ID;
    
        $field['choices'] = array();
    
        //Get the repeater field values
        $choices = get_field( 'dt_result', $post_id );
    
        $keys = array_keys($choices);
        for($i = 0; $i < count($choices); $i++) {
    
            foreach($choices[$keys[$i]] as $key => $value) {
    
                if($key == 'result_title'){
                    $title = $value;
    
                    //echo $value . "<br>";
                    $field['choices'][$title] = $title;
    
                }
            }
        }
    
        return $field;
    
    }
  • Hi,

    I figured out that this is not possible.

    Repeater
    – Repeater
    -Text Field
    – Repeater

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