Support

Account

Home Forums Add-ons Repeater Field Sort by date a repeater field Reply To: Sort by date a repeater field

  • Ok thank you for the explanation, here is what I achieve

    <? function my_acf_load_value( $value, $post_id, $field ) {
    
        $order = array();
        
    
        if( empty($value) ) {
            
            return $value;
            
        }
    
        foreach( $value as $i => $row ) {
            
        $order[ $i ] = strtotime($row['field_5794d01d5c71a']);
            
    }
    
        array_multisort( $order, SORT_DESC, $value );
      
        return $value;
        
    }?>
    
    <? add_filter('acf/load_value/key=field_5794d01d5c71a', 'my_acf_load_value', 10, 3);?>
    
    

    So far, the order of the content doesn’t seem to change.
    I can’t seem to find where the problem come from, any idea ?
    Thank you very much @james