7722f53f10
・ファイル名、クラス名の変更 ・タクソノミーの有効化で、カテゴリー、タグ、カスタム分類のメタキーを分割 ・表示用クラスの追加 ・readmeの追加等
100 lines
4.6 KiB
PHP
100 lines
4.6 KiB
PHP
<?php
|
|
$all_categories = APOP_UI::get_all_taxonomies( 'category' );
|
|
$all_tags = APOP_UI::get_all_taxonomies( 'post_tag' );
|
|
$all_tax = APOP_UI::get_all_taxonomies( 'taxonomy' );
|
|
?>
|
|
|
|
<div class="post-order-box">
|
|
<form action="" method="post">
|
|
<?php
|
|
wp_nonce_field( 'sh_options' );
|
|
$opt_cat = get_option( '_apop_cat_order' );
|
|
$opt_tag = get_option( '_apop_tag_order' );
|
|
$opt_tax = get_option( '_apop_tax_order' );
|
|
?>
|
|
<h2>対象タクソノミー選択</h2>
|
|
<table>
|
|
<?php if ( count( $all_categories ) > 0 ): ?>
|
|
<tr>
|
|
<th>カテゴリー</th>
|
|
<td>
|
|
<ul class="order_setting_list">
|
|
<?php foreach ( $all_categories as $category ): ?>
|
|
<?php $check_slug = $opt_cat['target_cat'][ $category->term_id ] ?? ''; ?>
|
|
<li>
|
|
<div class="select_cat">
|
|
<label>
|
|
<input type="hidden"
|
|
name="_apop_cat_order[target_cat][<?php echo $category->term_id; ?>]"
|
|
value="0">
|
|
<input type="checkbox"
|
|
name="_apop_cat_order[target_cat][<?php echo $category->term_id; ?>]"
|
|
<?php echo checked( $check_slug, 1 ); ?>
|
|
value="1">
|
|
<?php echo $category->name; ?>
|
|
</label>
|
|
</div>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php if ( count( $all_tags ) > 0 ): ?>
|
|
<tr>
|
|
<th>タグ</th>
|
|
<td>
|
|
<ul class="order_setting_list">
|
|
<?php foreach ( $all_tags as $tag ): ?>
|
|
<?php $check_slug = $opt_tag['target_cat'][ $tag->term_id ] ?? ''; ?>
|
|
<li>
|
|
<div class="select_cat">
|
|
<label>
|
|
<input type="hidden"
|
|
name="_apop_tag_order[target_cat][<?php echo $tag->term_id; ?>]"
|
|
value="0">
|
|
<input type="checkbox"
|
|
name="_apop_tag_order[target_cat][<?php echo $tag->term_id; ?>]"
|
|
<?php echo checked( $check_slug, 1 ); ?>
|
|
value="1">
|
|
<?php echo $tag->name; ?>
|
|
</label>
|
|
</div>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php if ( count( $all_tax ) > 0 ): ?>
|
|
<tr>
|
|
<th>カスタム分類</th>
|
|
<td>
|
|
<ul class="order_setting_list">
|
|
<?php foreach ( $all_tax as $tax ): $all_taxs = APOP_UI::get_all_taxonomies( $tax ) ?>
|
|
<?php foreach ( $all_taxs as $tax ): ?>
|
|
<?php $check_slug = $opt_tax['target_cat'][ $tax->term_id ] ?? ''; ?>
|
|
<li>
|
|
<div class="select_cat">
|
|
<label>
|
|
<input type="hidden"
|
|
name="_apop_tax_order[target_cat][<?php echo $tax->term_id; ?>]"
|
|
value="0">
|
|
<input type="checkbox"
|
|
name="_apop_tax_order[target_cat][<?php echo $tax->term_id; ?>]"
|
|
<?php echo checked( $check_slug, 1 ); ?>
|
|
value="1">
|
|
<?php echo $tax->name; ?>
|
|
</label>
|
|
</div>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</table>
|
|
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/>
|
|
</form>
|
|
</div>
|