Support

Account

Home Forums General Issues Admin Page Link Sorting

Helping

Admin Page Link Sorting

  • I’ve been trying to figure out how to have the sort order of the page_link select display by date, not title in ascending order. I’m not quite sure how to achieve this.

    Any insights on how to achieve this would be greatly appreciated.

    Thanks mate.

  • There are three filters that you may be able to use, but they are not documented.

    This is from ACF4 and is documented here: http://www.advancedcustomfields.com/resources/acf-fields-post_object-query/

    
    $args = apply_filters('acf/fields/post_object/query', $args, $field, $post);
    $args = apply_filters('acf/fields/post_object/query/name='.$field['_name'], $args, $field, $post );
    $args = apply_filters('acf/fields/post_object/query/key='.$field['key'], $args, $field, $post );
    

    This is from ACF5, these are not documented but would work the same way that the above filters work.

    
    $args = apply_filters('acf/fields/page_link/query', $args, $field, $options['post_id']);
    $args = apply_filters('acf/fields/page_link/query/name='.$field['name'], $args, $field, $options['post_id'] );
    $args = apply_filters('acf/fields/page_link/query/key='.$field['key'], $args, $field, $options['post_id'] );
    

    You may be able to reorder them by date. I’ve seen several topics here though that indicate that trying to alter the order of the posts can sometime break the returned results. This is because ACF groups the posts and pages and altering the sort order can cause the grouping to go wrong. The only thing you can do is try it.

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

The topic ‘Admin Page Link Sorting’ is closed to new replies.