Support

Account

Home Forums General Issues Replicate value of one field into another Reply To: Replicate value of one field into another

  • here is my code but doesnt work:

    
       function my_acf_load_field( $field ) {
            $current_date = get_sub_field('data');
            $trimmed = substr($current_date, -7);
            $field['default_value'] = $trimmed;
            $field['disabled'] = 1;
            return $field;  
        }
        add_filter('acf/load_field/name=month_year', 'my_acf_load_field');