WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
add_action ( 'edit_category_form_fields', 'tag_category_fields');
add_action ( 'edited_category', 'save_tag_category_fields');
add_action('wp_ajax_my_action', 'tag_category_fields');
function tag_category_fields($tag){
    $t_id = $tag->term_id;
    $tag_items_list = individual_tag();
    $mytags = $_POST['whatever'];

    <tr class="form-field">
    <th scope="row" valign="top"><label for="category_tag_list"><?php _e('Available Categary Tags'); ?></label></th>
    <form class="category_tag_list_values">
    <select id="list_category_tags" name="list_category_tags" style="width: 300px; padding: 5px; overflow-y: auto;" multiple="multiple">
    <?php foreach($tag_items_list as $tags){ ?>
        <option value="<?php echo $tags->name ?>"><?php echo $tags->name ?></option>
    <?php } ?>    
    <input class="uibutton" style="width: 75px" type="button" value="add">
    <br />
    <tr class="form-field">
    <th scope="row" valign="top"><label for="added_category_tag"><?php _e('Current Category Tags'); ?></label></th>
        <input id="mytags" name="mytags" />
        <br />
    <input type="hidden" name="listtag1" value="hi" />
    <?php foreach($mytags as $tags){
            echo '<input type="hidden" name="listtag" value="'.$tags.'" />';
}//add extra fields to category edit form hook

function save_tag_category_fields( $term_id ) {
       $value = $_POST['listtag'];

So What I'm trying to do is set values with jquery and ajax to set values and then perform actions with them when I save the category edit page but I can't seem to get the value into function save_tag_category_fields( $term_id ) function, help?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.