- This topic has 1 reply, 2 voices, and was last updated 5 years, 7 months ago by
Jason.
Viewing 1 reply thread
-
AuthorPosts
-
-
June 28, 2016 at 5:09 pm #6832
RachelMemberI’ve been trying to add a custom taxonomy, that in lieu of the required ‘Name’ field, using say, a piklist drop down. I’ve tried variations of the following to no success. Is this something that’s supported the way
'scope' => 'post', 'field' => 'post_title'is?piklist('field', array( 'type' => 'select', 'field' => 'name', 'scope' => 'taxonomy', 'choices' => piklist_get_states_and_slugs(true), ));Attachments:
You must be logged in to view attached files. -
June 28, 2016 at 7:48 pm #6834
JasonKeymasterHi @Rachel!
This is definitely possible! You can see an example of this in the Piklist Demos. Create a new Piklist Demos Post and then you’ll see the “Taxonomies” metabox on the side. You can also find the metabox in
/piklist/add-ons/piklist-demos/parts/meta-boxes/field-taxonomies.php. For ease I’ll paste it here, too:piklist('field', array( 'type' => 'checkbox' ,'scope' => 'taxonomy' ,'field' => 'piklist_demo_type' ,'label' => __('Demo Types', 'piklist-demo') ,'description' => sprintf(__('Terms will appear when they are added to %1$s the Demo taxonomy %2$s.','piklist-demo'), '<a href="' . network_admin_url() . 'edit-tags.php?taxonomy=piklist_demo_type&post_type=piklist_demo">', '</a>') ,'choices' => piklist( get_terms('piklist_demo_type', array( 'hide_empty' => false )) ,array( 'term_id' ,'name' ) ) ));Hope this helps! 🙂
-
-
AuthorPosts
Viewing 1 reply thread
- You must be logged in to reply to this topic.