Files
POST_ORDER_BY_ARCHIVE/template/setting.php
T
nobu 2ed2b25194 WP PLUGIN アーカイブ毎に投稿表示順を設定する
・ベース部分(カテゴリー、投稿)の表示順用カスタムフィールド設定登録の作成
2021-05-03 18:51:02 +09:00

33 lines
1.2 KiB
PHP

<?php
//各種パラメータ
$all_categories = get_categories();
?>
<div class="post-order-box">
<form action="" method="post">
<?php
wp_nonce_field( 'sh_options' );
$opt = get_option( 'post_cat_order' );
?>
<h2>対象カテゴリー選択</h2>
<ul class="order_setting_list">
<?php foreach ( $all_categories as $category ): ?>
<li>
<div class="select_cat">
<label>
<input type="hidden"
name="post_cat_order[target_cat][<?php echo $category->slug; ?>]"
value="0">
<input type="checkbox"
name="post_cat_order[target_cat][<?php echo $category->slug; ?>]"
<?php echo checked( $opt['target_cat'][ $category->slug ], 1 ); ?>
value="1">
<?php echo $category->name; ?>
</label>
</div>
</li>
<?php endforeach; ?>
</ul>
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/>
</form>
</div>