Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
add_action ( 'edit_category_form_fields', 'extra_category_fields');
add_action ( 'edited_category', 'save_extra_category_fields');
add_action('wp_ajax_my_action', 'save_extra_category_fields');

action calls

 function extra_category_fields($tag){
    $t_id = $tag->term_id;
    $tag_items_list = individual_tag();
    ?>

    <tr class="form-field">
    <th scope="row" valign="top"><label for="category_tag_list"><?php _e('Available Categary Tags'); ?></label></th>
    <td>
    <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 } ?>    
    </select>
    <br/>
    <input class="uibutton" style="width: 75px" type="button" value="add">
    </form>
    <br />
    </td>
    </tr>
    <tr class="form-field">
    <th scope="row" valign="top"><label for="added_category_tag"><?php _e('Current Category Tags'); ?></label></th>
    <td>
        <input id="mytags" name="mytags" />
        <br />
    </td>
    </tr>
    <?php
}//add extra fields to category edit form hook

added additional information to the category edit page

function save_extra_category_fields( $term_id ) {
    if ( isset( $_POST['whatever'] ) ) {
        $t_id = $term_id;
        $getTagId = individual_tag();
        $mytags = $_POST['whatever'];    
        }
    echo $term_id;
}

Saving information block

so when I'm in the category edit page for a specific category I can't seem to get $term_id to call the category id does anyone know why or is there a better way in doing it?

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.