Support

Account

Home Forums Add-ons Repeater Field Fill up repeater fields with category Reply To: Fill up repeater fields with category

  • Thanks it help me to solve my problem (sorry for the time to answer you ^^’)

    For those who want my entire code :

    function acf_load_taxonomy_custom_urls_table($value, $post_id, $field){
        
    $args = array( 'taxonomy' => 'ville_formation');
    $post_categories = wp_get_post_terms( get_the_ID(), 'ville_formation', array("fields" => "ids") );
    
    if ( !empty( $post_categories ) ) {
      $args['exclude'] = $post_categories;
    };
    
    $categories = get_terms( $args );
    
    $value=array();
    
      if (empty($value)) {
        foreach (  $categories as $category ) {
            $value [] =  array(
                'field_5cd186302ef1c' => $category->name);
       }     
        
        };
    return $value; 
    };
    add_filter('acf/load_value/name=villes_a_ajouter_III', 'acf_load_taxonomy_custom_urls_table', 10, 3);