A PHP Error was encountered
Severity: Notice
Message: Undefined index: userid
Filename: views/question.php
Line Number: 191
Backtrace:
File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler
File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view
File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once
wordpress custom taxonomy metabox 'select', doesnt replace value just add another on top
I am adding custom taxonomy to woo product in wordpress using custom taxonomy and creating a box for it with:
$args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'meta_box_cb' => 'drop_cat', 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'type' ) );
and the custom metabox code :
function drop_cat( $post, $box ) { $defaults = array('taxonomy' => 'category'); if ( !isset($box['args']) || !is_array($box['args']) ) $args = array(); else $args = $box['args']; extract( wp_parse_args($args, $defaults), EXTR_SKIP ); $tax = get_taxonomy($taxonomy); ?> "; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. ?> $term_obj = wp_get_object_terms($post->ID, $taxonomy ); //_log($term_obj[0]->term_id)?> ID, array( 'taxonomy' => $taxonomy) ) ?>
The problem is that after making new product first value is auto assigning first value for product, which i want to avoid, and afterwards if i choose another option it saves in backend and shows which option was selected, but in single product prints previous selections also, so how do i get it to allow only one option to be selected and default to be empty? or any other way arround this? what i am trying to achive is electronic products energy raiting ( 8 values total ) i want it as dropdown/select to reduce screen size space taken as i have many custom taxonomies.