Relational posts not showing in admin columns
Support › MB Admin Columns › Relational posts not showing in admin columnsResolved
- This topic has 7 replies, 2 voices, and was last updated 5 years ago by
Long Nguyen.
-
AuthorPosts
-
April 23, 2020 at 2:54 PM #19239
SAND
ParticipantHi,
I want to show relational posts in the admin columns.
I've created a relation between 'Aandoeningen' and 'Behandelingen'.
https://share.getcloudapp.com/8Lujjo6AI've installed and activated MB Admin Columns and added 'admin_column' => true, (or 'after title') to the relation:
https://share.getcloudapp.com/Kouqq4vOBut the relational posts are not shown in the admin columns:
https://share.getcloudapp.com/wbu00bjLI guess I'm missing something, but what?
Please, help me out.April 23, 2020 at 4:04 PM #19240Long Nguyen
ModeratorHi,
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/33e79a24a93cCould 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! ], ] ); } );
April 23, 2020 at 4:43 PM #19241SAND
ParticipantI 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/Apujjx48April 23, 2020 at 8:38 PM #19245Long Nguyen
ModeratorHi,
The problem is the slug of post type, it should be
'post_type' => 'aandoening',
not the singular nameAandoening
. Please change the relationship code and check the admin column again.April 23, 2020 at 10:27 PM #19249SAND
ParticipantGreat, 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?April 24, 2020 at 9:42 AM #19254Long Nguyen
ModeratorHi,
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.
April 24, 2020 at 4:42 PM #19266SAND
ParticipantHi,
With the plugin Admin Columns (https://www.admincolumns.com/) the admin columns can be edited inline.
April 27, 2020 at 10:44 AM #19306Long Nguyen
ModeratorHi,
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.
-
AuthorPosts
- You must be logged in to reply to this topic.