Checkbox Tree not displayed in Sub-group fields
- This topic has 7 replies, 2 voices, and was last updated 3 years, 2 months ago by
indatext.com.
-
AuthorPosts
-
February 18, 2022 at 11:06 PM #33987
indatext.com
ParticipantIf a hierarchical taxonomy is set to display in a sub-group Taxonomy Advanced field with a checkbox tree option, than is does not display sub-terms. If set to Select Advanced, it finds sub-terms, but does not save those.
For a normal field, not a part of sub-group it displays OK.
February 19, 2022 at 10:29 AM #34000Long Nguyen
ModeratorHi,
The subfield
taxonomy_advanced
in a group, field typecheckbox_tree
works as well on my site. Screenshot https://imgur.com/iNBMl1Z
Code:'fields' => [ [ 'name' => __( 'Group', 'your-text-domain' ), 'id' => $prefix . 'group_6rzszh8tdbl', 'type' => 'group', 'fields' => [ [ 'name' => __( 'Taxonomy Advanced', 'your-text-domain' ), 'id' => $prefix . 'taxonomy_advanced_hm330v010b', 'type' => 'taxonomy_advanced', 'taxonomy' => ['category'], 'field_type' => 'checkbox_tree', ], ], ], ],
February 20, 2022 at 1:40 AM #34015indatext.com
ParticipantBut it does not display that on my side
[ 'name' => __( 'Type of Glass', 'your-text-domain' ), 'id' => $prefix . 'door_glass_type_selector', 'type' => 'taxonomy_advanced', 'label_description' => __( 'only select one type for this variant', 'your-text-domain' ), 'taxonomy' => ['type-of-glass'], 'field_type' => 'checkbox_tree', 'remove_default' => true, ],
February 20, 2022 at 2:17 AM #34016indatext.com
ParticipantI also have additional meta-definition for setting pics for terms in custom plugin as:
// Add custom meta for Types of Glass Taxonomy add_filter( 'rwmb_meta_boxes', 'prefix_register_taxonomy_meta_boxes' ); function prefix_register_taxonomy_meta_boxes( $meta_boxes ){ $meta_boxes[] = array( 'title' => 'Additional Meta for Doors', 'taxonomies' => array('type-of-glass','jamb'), // THIS: List of taxonomies. Array or string 'fields' => array( array( 'name' => 'Featured?', 'id' => 'featured_glass', 'type' => 'checkbox', ), array( 'name' => 'Preview Image', 'id' => 'glass_single_image', 'type' => 'single_image', ), ), ); return $meta_boxes; }
Maybe that is causing the issue. What to use instead of
taxonomies
for array of taxonomies here, if one of taxonomies is advanced taxonomy?February 20, 2022 at 10:20 PM #34020Long Nguyen
ModeratorHi,
Please tick the parent term to show child terms like my screenshot https://imgur.com/iNBMl1Z
The term meta does not relate to this case.February 21, 2022 at 10:17 PM #34040indatext.com
ParticipantAha! Thank you. Is there a way to display hierarchical taxonomy not collapsed by default, or at least somehow visually indicate terms with children?
February 22, 2022 at 10:06 AM #34051Long Nguyen
ModeratorHi,
There is no option to display the child term by default or mark the parent term with a specific character. I will inform the development team to consider supporting this case in future updates.
February 22, 2022 at 3:51 PM #34053indatext.com
ParticipantI shall try to implement it, since Metabox allows a lot of customisation on the back end and I figured out how to load amending styles. But yes, from a layperson perspective the expected default behaviour is to have checkbox tree blooming, not collapsed. Since it is a default behaviour in side panel WP Metabox.
-
AuthorPosts
- You must be logged in to reply to this topic.