目次
functions.php
function add_post_restrict_taxonomy() {
global $post_type;
if ( 'post' == $post_type ) {
?>
<select name="item_category">
<option value="">タクソノミー一覧</option>
<?php
$terms = get_terms('item_category');
foreach ($terms as $term) { ?>
<option value="<?php echo $term->slug; ?>"><?php echo $term->name; ?></option>
<?php } ?>
</select>
<?php
}
}
add_action( 'restrict_manage_posts', 'add_post_restrict_taxonomy' );
コメント