Tagged: checkboxes, user taxonomy
- This topic has 3 replies, 2 voices, and was last updated 7 years, 8 months ago by
Steve.
Viewing 3 reply threads
-
AuthorPosts
-
-
May 29, 2014 at 11:24 pm #1770
norbooMemberI created a user taxonomy called “Company Types” which shows nicely on user profiles as a checkbox list.
/* Register Taxonomy */ function piklist_custom_taxonomies($taxonomies) { $taxonomies[] = array( 'object_type' => 'user' ,'name' => 'company_type' ,'configuration' => array( 'hierarchical' => true ,'labels' => piklist('taxonomy_labels', 'Company Type') ,'show_ui' => true ,'query_var' => true ,'rewrite' => array( 'slug' => 'business-directory' ) ,'show_admin_column' => true ) ); return $taxonomies; } /* User Fields */ piklist('field', array( 'type' => 'checkbox' ,'scope' => 'taxonomy' ,'field' => 'company_type' ,'label' => 'Company Types' ,'description' => 'Choose only two categories.' ,'choices' => piklist( get_terms('company_type', array( 'hide_empty' => false )) ,array( 'term_id' ,'name' ) ) ));I’d like to know if there is a way to group the terms as follows and not just a flat list of parents and child all with checkboxes:
ParentTerm#1 (no checkbox)
[]Child#1-1
[]Child#1-2
[]Child#1-3ParentTerm#2 (no checkbox)
[]Child#1-1
[]Child#1-2
[]Child#1-3Any lead is greatly appreciated.
-
May 30, 2014 at 12:49 pm #1774
SteveKeymasterFelt like this needed a tutorial. Let me know if this helps >
-
June 2, 2014 at 5:38 am #1780
norbooMemberThanks Steve!
Exactly what I needed!Amazing plugin and…amazing people!
-
June 2, 2014 at 9:52 am #1782
-
-
AuthorPosts
Viewing 3 reply threads
- You must be logged in to reply to this topic.