It was a long way around to get there but you basically have a markup error. You didn’t name your select. You should have:
<select id="select-taxonomy" name="<?php echo $name ?>"> // <-- here is the change
<?php foreach($terms as $term) {
$id = $taxonomy.'-'.$term->term_id;
$value= (is_taxonomy_hierarchical($taxonomy) ? "value="{$term->term_id}"" : "value="{$term->term_slug}"");
echo "<option id='in-$id' ". selected($current,$term->term_id,false) ." {$value} />$term->name</option>";
} ?>
</select>
You don’t name the individual options. You name the select
itself. With that change, it works just fine.
Related Posts:
- How can I create a taxonomy meta-box with search suggestions but no new terms input?
- How to group meta boxes on the post edit page
- Is there a filter/action to add content to WP admin metaboxes?
- Consolidate Metaboxes into 1 Big Metabox
- How to remove/hide the predictive autocomplete popup when I type in the tag/term metabox
- Taxonomy as checkboxes
- metabox with custom post type values
- Display Term Metabox Only On Certain Term Edit and Add Pages In Admin
- multi custom fields and taxonomy search
- How to show taxonomy terms from wordpress database?
- How to make a metabox that contains link categories?
- issue with saving custom metaboxes fields
- Multiple category filters
- Is There a Difference Between Taxonomies and Categories?
- Create more Meta Boxes as needed
- How to show a hierarchical terms list?
- Set Default Admin Screen options & Metabox Order
- How to set default screen options?
- Passing error/warning messages from a meta box to “admin_notices”
- get_terms by custom post type
- Need a simple but complete example of adding metabox to taxonomy
- Add “upload media” button in meta box field
- Can I add a Category Metabox to attachment?
- Add a Meta Box for uploading a SECOND Featured Image?
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Custom Taxonomy as checkbox or dropdown
- Does WordPress have a “Form API”?
- Metabox with checkbox is not updating
- Check if a post is in any child category of a parent category
- How to HIDE everything in PUBLISH metabox except Move to Trash & PUBLISH button
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- What is the “Advanced” $context in add_meta_box?
- Removing panels (meta boxes) in the Block Editor
- Change The Title Of a Meta Box
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- How to make open/closed and hidden/shown metaboxes status saved on a per-post basis?
- How To Remove The “+ Add New Category” Link From A Category Metabox
- Taxonomy dropdown metabox in the back-end
- Remove the Featured Image Meta Box
- Remove the Yoast SEO Post Metabox [closed]
- Best practices for meta box placement?
- Creating a metabox to upload multiple images
- How Does WordPress Remember Metabox Positions?
- Sample code for validating custom metabox?
- tax_query in get_posts() not working?
- Post custom metabox textarea using wp_editor
- How to display non-hierarchical taxonomy as terms with checkboxes?
- How to Add Reminders/Notes to New Post Meta Boxes
- How do I get attachment_id?
- Removing Metabox for “Slug” without removing functionality
- How to reorder meta box position?
- What is wp_insert_term “alias_of” arg for?
- Prevent sorting and dragging of specific postbox metabox
- Automatically Assign Parent Terms When A Child Term is Selected
- One metabox for multiple post types
- How do I position meta_box on post edit screen after the title?
- Control term order on a per-post basis
- How to add a class to meta box
- get term by id without taxonomy
- How to limit the number of terms (terms acts like categories)
- Custom taxonomy hide meta box but show in menu
- Custom Post Type – Taxonomy Dropdown Menu?
- Has anyone successfully integrated qtranslate with custom metaboxes?
- Put the media uploader in a metabox
- Custom Meta Boxes: multiple fields within a repeatable field
- How do I list custom taxonomy terms without the links?
- get a specific taxonomy term name
- Exclude specific slug in ‘get_terms’
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Removing meta boxes: remove-meta_box() or unset()?
- Save checkbox value in metabox
- wp_set_object_terms() Fails to Set Terms
- Is there a way to disable a term rather than deleting it?
- Use meta box drag and drop to order items independently
- wp_insert_term doesn’t work with custom post type’s taxonomy
- inside a metabox
- Add Meta box Befoure Post Title
- Hiding a theme’s meta box
- Modify Term Update Redirection
- Metabox date month number to word
- List Hierarchical Term List with Count with Related Term
- How can I select a primary category?
- get registered metaboxes by post type or post ID
- How are terms connected with posts in database?
- show tags of custom post type ONLY
- Remove metabox from specific page template in admin
- Attach Files Metabox
- Is there a way to set singular/plural labels for taxonomy term names?
- CMB2 metabox conditional logic
- Return only the custom sub-term for custom post type, do not echo term-parent
- Better way to enforce category hierarchy in post_categories_metabox?
- get_terms() How many is TOO many?
- Tinymce/WordPress is removing all line-breaks?
- How do I create a meta box for dates?
- Adding submit or update button to custom metabox?
- Check if current term is a child of another term
- Count posts that have specific taxonomy term attached
- Retrieve single term slug
- get_terms() doesn’t return empty terms even though hide_empty is false
- Why is my WP_Query not working when tax_query terms are an array?