The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Posts 2 Posts
Sorting connected post in admin listing (1 post)

  1. ajaxian
    Posted 2 years ago #


    I have 2 Custom Post Types, in relation one_to_many
    Artist has_many Work and a Work belongs to one Artist.
    My problem is in admin panel, when i list the Works posts.
    I had the artist column but i'am completely unable to sort/order the Work when I click on Artist column.

    add_filter("manage_edit-oeuvre_sortable_columns", 'oeuvres_sort');
    function oeuvres_sort($columns)
    $columns['p2p-to-artist_to_work'] = 'artist';
    return $columns;

    function artist_column_orderby($request)

    if (isset($request['orderby']) && 'artiste' == $request['orderby']) {
    $request = array_merge($request, array(
    'meta_key' => 'artist',
    'connected_direction' => 'to',
    'connected_items' => 'any',

    return $request;

    add_filter('request', 'artist_`column_orderby');

    I try several things in the artist_column_orderby function but none of them works.

    Do you know how to achieve this ?

    Thank in advance


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.