Support

Account

Home Forums Backend Issues (wp-admin) post object field sort order Reply To: post object field sort order

  • Hi @hagedorn,

    Thanks for the post.

    To get this done, you will need the following code:

    function my_post_object_query( $args, $field, $post )
    {
        // modify the order
        $args['orderby'] = 'date';
        $args['order'] = 'DESC';
    
        return $args;
    }
    
    // filter for a specific field based on it's name
    add_filter('acf/fields/post_object/query/name=heft', 'my_post_object_query', 10, 3);