用于支持WordPress中的wp_editor的术语的自定义元框

时间:2017-04-11 13:13:28

标签: wordpress

如何在支持WP_Editor的WordPress中为术语创建自定义元框?我找不到合适的结果。

function bj_taxonomy_edit_meta_field($term) {
    $t_id = $term->term_id;
    $term_meta = get_option("taxonomy_$t_id");
    ?>
    <tr class="form-field">
        <th scope="row" valign="top"><label for="term_meta[custom_term_meta]"><?php _e('Case Studies Section', 'site'); ?></label></th>
        <td>
            <textarea name="term_meta[custom_term_meta]" id="term_meta[custom_term_meta]" rows="5" cols="40"><?php echo ($term_meta['custom_term_meta'] ) ? $term_meta['custom_term_meta'] : ''; ?></textarea>
            <p class="bj-description"><?php _e('Enter a value for this field', 'site'); ?></p>
        </td>
    </tr>
    <?php
}

add_action('practice-area_edit_form_fields', 'bj_taxonomy_edit_meta_field', 10, 2);

0 个答案:

没有答案