- This topic has 3 replies, 2 voices, and was last updated 2 years, 1 month ago by .
-
Topic
-
Hi, I’m having trouble creating an admin column for a custom taxonomy term. Using the docs from:
https://docs.metabox.io/extensions/meta-box-builder/
https://docs.metabox.io/extensions/mb-admin-columns/The taxonomy term is created manually in my theme (it was created before I started using the MB plugin).
Using the MB Builder to add a custom meta field to the term.
When I add the advanced attribute using the dot notation:
Advanced attribute key: admin_columns.0.position
Advanced attribute value: before nameAdvanced attribute key: admin_columns.0.sort
Advanced attribute value: 1The generated code for the field array looks like:
'fields' => array( array ( 'id' => 'custom_order', 'type' => 'number', 'name' => 'Order', 'step' => 1, 'required' => 1, 'label_description' => 'Specify the order in which the Player Positions will be displayed.', 'admin_columns' => array ( 0 => array ( 'position' => 'before name', 'sort' => 1, ), ), ), ),
When I use JSON:
Advanced attribute key: admin_columns
Advanced attribute value: [{“position”:”before name”,”sort”:”1″}]The generated code for the field array looks like:
'fields' => array( array ( 'id' => 'custom_order', 'type' => 'number', 'name' => 'Order', 'step' => 1, 'required' => 1, 'label_description' => 'Specify the order in which the Player Positions will be displayed.', 'admin_columns' => array ( 0 => array ( 'position' => 'before name', 'sort' => '1', ), ), ), ),
In both cases the admin_columns array is nested a level too deep. What am I doing wrong?
Thanks in advance.
- You must be logged in to reply to this topic.