Viewing 2 replies - 1 through 2 (of 2 total)
  • I also could use a method to order get_fields() in relation to the ACF fields ordering

    I came up with a solution for this:

    $fields = get_fields();
    
    if( $fields )
    {
    
        // Reorder based on menu order, rather than id
        foreach( $fields as $field_name => $value )
        {
            $field = get_field_object($field_name, false, array('load_value' => false));
    
            $menu_order[$field_name] = $field["menu_order"];
        }
    
        array_multisort($menu_order, SORT_ASC, $fields);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘sort with get_fields() by field order’ is closed to new replies.