Custom Fields
Re-Envisioned
Support MB Relationships Relationship Admin Column not showing data

This topic contains 5 replies, has 2 voices, and was last updated by  Anh Tran 4 months, 2 weeks ago.

  • Creator
    Topic
  • #11475
    Resolved
    Max Elman
    Participant

    Using the below code, and column headers are created, but no data is showing in the columns.

    Screenshot of column: https://cl.ly/7cbffe5d6bc1

    Screenshot of relationship: https://cl.ly/ac94e6b15fa2

    add_action( 'mb_relationships_init', function() {
        
        // attorneys to events
        MB_Relationships_API::register( array(
            'id'   => 'attorney_to_event',
           
            'from' => array(
                'post_type'   => 'attorney',
                'meta_box'    => array(
                    'title'       => 'Linked Events',
                ),
            ),
            'to' => array(
                'post_type'   => 'event',
                
                'admin_column' => array(
                    'position'   => 'after title',
                    'title'      => 'Speakers',
                ),
                
                'meta_box'    => array(
                    'title'       => 'Linked Attorney',
                ),
            ),
        ) );
    } );
Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #11478

    Anh Tran
    Keymaster

    Hi Max,

    Your code seems to be correct. Would you mind sending me a temporary admin account to check?

    #11482

    Max Elman
    Participant

    Sent, thanks.

    #11483

    Anh Tran
    Keymaster

    Just fixed it on your website and on Github. It’s a bug caused by a previous commit for post_type=any.

    Thanks for letting me know the bug!

    #11491

    Max Elman
    Participant

    Thank you! I was going a little crazy troubleshooting that myself.

    Two related questions:

    1) Why is the code within relationships ‘admin_column’ and within the full admin columns extension ‘admin_columns’? (Difference in ‘s’)

    2) Are the full admin column parameters supported within relationships? (before, after, sort, searchable, filterable)

    #11494

    Anh Tran
    Keymaster

    Hi Max,

    1) When we work on admin column for relationship at first, we thought it’s a single relationship column, so we use singular form. The Admin Columns extension was made for multiple fields, so it’s plural.

    2) For relationships: it’s not supported. Because the relationships are list of connections and will be unclear when we put something like sorting, search for those connections.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.