Support

Account

Home Forums General Issues Posts Object Field order

Solved

Posts Object Field order

  • Can I change the posts order of Post Object Field without having to edit /core/fields/post_object.php file?

  • Sorry. Just had to use the same logic found on Customize the relationship field list query.

    Here’s the code:

    add_filter( 'acf/fields/post_object/query', 'change_posts_order' );
    function change_posts_order( $args ) {
    	$args['orderby'] = 'date';
    	$args['order'] = 'DESC';
    	return $args;
    }
  • And NOW I found the solution on the documentation.
    Sorry. I’ll try to read first before I post again. 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Posts Object Field order’ is closed to new replies.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.