Support Forum
Support › MB Admin Columns › Relational posts not showing in admin columnsResolved
Hi,
I want to show relational posts in the admin columns.
I've created a relation between 'Aandoeningen' and 'Behandelingen'.
https://share.getcloudapp.com/8Lujjo6A
I've installed and activated MB Admin Columns and added 'admin_column' => true, (or 'after title') to the relation:
https://share.getcloudapp.com/Kouqq4vO
But the relational posts are not shown in the admin columns:
https://share.getcloudapp.com/wbu00bjL
I guess I'm missing something, but what?
Please, help me out.
Hi,
I've tested on my local site, the relationships and admin columns still display as well. Please see my screenshots
https://cl.ly/68be801b777f
https://cl.ly/33e79a24a93c
Could you please deactivate all plugins except Meta Box plugins then check the problem again?
Or you can test with sample relationships between posts and pages
add_action( 'mb_relationships_init', function() {
MB_Relationships_API::register( [
'id' => 'posts_to_pages',
'from' => [
'object_type' => 'post',
'post_type' => 'post',
'meta_box' => [
'title' => 'Connect Pages',
'priority' => 'high',
],
'admin_column' => 'after title', // THIS!
],
'to' => [
'object_type' => 'post',
'post_type' => 'page',
'meta_box' => [
'title' => 'Connect Posts',
'priority' => 'high',
],
'admin_column' => 'after title', // THIS!
],
] );
} );
I have deactivated most of the plugins but the connected cpt's still did not show in the admin columns.
But your code for relationships between posts and pages does work (with all plugins activated).
Can it be caused by the way I have setup the post types?
https://share.getcloudapp.com/Apujjx48
Hi,
The problem is the slug of post type, it should be 'post_type' => 'aandoening',
not the singular name Aandoening
. Please change the relationship code and check the admin column again.
Great, that was it, it works now!
Will it be difficult to make the fields editable in the admin columns?
So that it would be possible to add related post types in the admin columns?
Hi,
Does that mean the Quick Edit option? https://cl.ly/da7757a7bb53
I will discuss this with the developer team to create a new feature to support this case. Thanks for the idea.
Hi,
With the plugin Admin Columns (https://www.admincolumns.com/) the admin columns can be edited inline.
Hi,
Currently, we are researching and developing feature supports to change the value of Admin columns in Quick Edit. If you really want to make the admin columns editable, please try to use the plugin Admin Columns and their addon Meta Box Integration.
Thank you.