wordpress中的自定义分类,+ 1个新输入

时间:2014-08-17 15:34:38

标签: wordpress taxonomy

可以在自定义分类中添加新输入吗?

1 个答案:

答案 0 :(得分:0)

是的,这很容易。您可以使用教程here

这是您需要使用的代码:

<?php
// Add term page
function pippin_taxonomy_add_new_meta_field() {
    // this will add the custom meta field to the add new term page
    ?>
    <div class="form-field">
        <label for="term_meta[custom_term_meta]"><?php _e( 'Example meta field', 'pippin' ); ?></label>
        <input type="text" name="term_meta[custom_term_meta]" id="term_meta[custom_term_meta]" value="">
        <p class="description"><?php _e( 'Enter a value for this field','pippin' ); ?></p>
    </div>
<?php
}
add_action( 'category_add_form_fields', 'pippin_taxonomy_add_new_meta_field', 10, 2 );