Getting checked Taxonomy values into a metabox
-
So I am working on a beer site, where I want to present beer with pictures of the beer, in the correct sizes. So found some code on the internet that gets me halfway there, but hoping someone can get me all the way there (I’ve crashed my site 50+ times trying to create it myself).
So I want the checked terms under ‘unit’ to generate an select picture link./** * Register a taxonomy for units. * * @link https://codex.www.ads-software.com/Function_Reference/register_taxonomy */ protected function register_taxonomy_unit() { $labels = array( 'name' => __('Units', '$textdomain'), 'singular_name' => __('Unit', '$textdomain'), 'menu_name' => __('Units', '$textdomain'), 'edit_item' => __('Edit Unit', '$textdomain'), 'update_item' => __('Update Unit', '$textdomain'), 'add_new_item' => __('Add New Unit', '$textdomain'), 'new_item_name' => __('New Unit Name', '$textdomain'), 'parent_item' => __('Parent Unit', '$textdomain'), 'parent_item_colon' => __('Parent Unit:', '$textdomain'), 'all_items' => __('All Units', '$textdomain'), 'search_items' => __('Search Units', '$textdomain'), 'popular_items' => __('Popular Units', '$textdomain'), 'separate_items_with_commas' => __('Separate Units with commas', '$textdomain'), 'add_or_remove_items' => __('Add or remove Units', '$textdomain'), 'choose_from_most_used' => __('Choose from the most used Units', '$textdomain'), 'not_found' => __('No Units found.', '$textdomain'), ); $args = array( 'labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'hierarchical' => true, 'rewrite' => array( 'slug' => 'unit' ), 'show_admin_column' => true, 'query_var' => true, ); $args = apply_filters('beer_post_type_unit_arg', $args); register_taxonomy($this->taxonomies[3], $this->post_type, $args); }
The code for more pictures
Upload multiple featured images in a custom post (WordPress) – Stack OverflowIt gives me this metabox:
But what i am looking for is, if unit looks look this:
And then the picture chooser look like this:
I really hope someone can help me with this.
Thanks in advance
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- You must be logged in to reply to this topic.