<li>
<label><?php _e( 'Coupon Category:', APP_TD ); ?> </label>
<?php
$args = array( 'taxonomy' => APP_TAX_CAT, 'selected' => $field['cat'], 'hierarchical' => 1, 'class' => 'text required', 'show_option_none' => __( '-- Select One --', APP_TD ), 'hide_empty' => 0, 'echo' => 0 );
$select = wp_dropdown_categories( $args );
$select = str_replace('id=', 'multiple="multiple" id=', $select);
if (is_array($taxonomy_default)) {
foreach ($taxonomy_default as $key => $post_term) {
$select = str_replace(' value="' . $post_term . '"', ' value="' . $post_term . '" selected="selected"', $select);
}
} else {
$select = str_replace(' value="' . $taxonomy_default . '"', ' value="' . $taxonomy_default . '" selected="selected"', $select);
}
$select = preg_replace('"-1"', "", $select); // remove the -1 for the "select one" option so jquery validation works
echo $select;
?>
</li>
<li>
<label><?php _e( 'Coupon Category:', APP_TD ); ?> </label>
<?php
$args = array( 'taxonomy' => APP_TAX_CAT, 'selected' => $field['cat'], 'hierarchical' => 1, 'class' => 'text required', 'show_option_none' => __( '-- Select One --', APP_TD ), 'hide_empty' => 0, 'echo' => 0 );
$select = wp_dropdown_categories( $args );
$select = str_replace('name=\'cat\' id=\'cat\'', 'name=\'cat[]\ multiple="multiple" id=\'cat\'', $select);
if (is_array($taxonomy_default)) {
foreach ($taxonomy_default as $key => $post_term) {
$select = str_replace(' value="' . $post_term . '"', ' value="' . $post_term . '" selected="selected"', $select);
}
} else {
$select = str_replace(' value="' . $taxonomy_default . '"', ' value="' . $taxonomy_default . '" selected="selected"', $select);
}
$select = preg_replace('"-1"', "", $select); // remove the -1 for the "select one" option so jquery validation works
echo $select;
?>
</li>
There are currently 1 users browsing this thread. (0 members and 1 guests)