Files
POST_ORDER_BY_ARCHIVE/template/order.php
T
nobu df9c7deef1 WP PLUGIN 投稿表示順設定
・タクソノミーのソート順登録/未登録両方取得するようget_postsのパラメータを修正
・タクソノミーのソート順登録/未登録両方取得に伴いテンプレートを修正
・通常と検索のソート順登録/未登録両方取得するようget_postsのパラメータを修正
・「表示設定に従う」メニューへposts_per_pageの設定件数を表示
・バグ修正:検索設定のnema属性修正と検索ページのメソッド引数修正
2021-05-08 12:58:05 +09:00

183 lines
9.4 KiB
PHP

<?php
$normal_lists = APOP_UI::get_all_search_normal_posts( 'normal' );
$search_lists = APOP_UI::get_all_search_normal_posts( 'search' );
$category_lists = array( 'category' => APOP_UI::get_cat_tag_list( 'cat', 'category' ) );
$tag_lists = array( 'tag_id' => APOP_UI::get_cat_tag_list( 'tag', 'post_tag' ) );
$taxonomy_lists = array( 'taxonomy' => APOP_UI::get_cat_tag_list( 'tax', 'taxonomy' ) );
$submit_type = APOP_UI::input_post_filter( 'submit_type', 'str' );
$apop_search_order_check = APOP_UI::get_order_type( '_apop_search_order' );
$apop_normal_check = APOP_UI::get_order_type( '_apop_normal_order' );
?>
<div class="post-setting-box">
<h2>並べ替え</h2>
<nav class="post-order-nav">
<ul>
<li class="en">通常</li>
<li>検索</li>
<li>カテゴリー</li>
<li>タグ</li>
<li>カスタム分類</li>
</ul>
</nav>
<div class="post-order-box-outer" data-submit_type="<?php echo $submit_type; ?>">
<div class="post-order-box">
<div class="list-orders-outer">
<?php $exclude_posts = []; ?>
<div class="list-orders-inner search_inner">
<form action="" method="post">
<?php wp_nonce_field( 'sh_options' ); ?>
<ul class="apop_normal_order_target"
data-normal_order_target="<?php echo $apop_normal_check; ?>">
<li><label>
<input class="apop_normal_order" type="radio" name="_apop_normal_order"
value="1"<?php checked( $apop_normal_check, 1 ); ?>>標準</label></li>
<li><label>
<input class="apop_normal_order" type="radio" name="_apop_normal_order"
value="2"<?php checked( $apop_normal_check, 2 ); ?>>カスタム</label></li>
</ul>
<hr>
<div class="normal_sort_box">
<?php list( $list, $alert ) = APOP_UI::create_search_normal_list( 'normal' ); ?>
<?php echo $alert; ?>
<ul class="post-order-list search_normal_sort">
<?php echo $list; ?>
</ul>
</div>
<div class="normal_sort_box">
<?php echo APOP_UI::none_registered_alert_msg(); ?>
<ul class="post-order-list">
<?php echo APOP_UI::get_all_search_normal_posts( 'normal' ); ?>
</ul>
</div>
<input type="hidden" name="submit_type" value="0">
<p class="submit post-order"><input type="submit" name="Submit" class="button-primary"
value="変更を保存"/></p>
</form>
</div>
</div>
</div>
<div class="post-order-box">
<div class="list-orders-outer">
<?php $exclude_posts = []; ?>
<div class="list-orders-inner search_inner">
<form action="" method="post">
<?php wp_nonce_field( 'sh_options' ); ?>
<ul class="apop_search_order_target"
data-search_order_target="<?php echo $apop_search_order_check; ?>">
<li><label>
<input class="apop_search_order" type="radio" name="_apop_search_order"
value="1"<?php checked( $apop_search_order_check, 1 ); ?>>標準</label></li>
<li><label>
<input class="apop_search_order" type="radio" name="_apop_search_order"
value="2"<?php checked( $apop_search_order_check, 2 ); ?>>カスタム</label></li>
</ul>
<hr>
<div class="search_sort_box">
<?php list( $list, $alert ) = APOP_UI::create_search_normal_list( 'search' ); ?>
<?php echo $alert; ?>
<ul class="post-order-list search_normal_sort">
<?php echo $list; ?>
</ul>
</div>
<div class="search_sort_box">
<?php echo APOP_UI::none_registered_alert_msg(); ?>
<ul class="post-order-list">
<?php echo APOP_UI::get_all_search_normal_posts( 'search' ); ?>
</ul>
</div>
<input type="hidden" name="submit_type" value="1">
<p class="submit post-order"><input type="submit" name="Submit" class="button-primary"
value="変更を保存"/></p>
</form>
</div>
</div>
</div>
<div class="post-order-box">
<?php foreach ( $category_lists as $tax_key => $tax_list ) : ?>
<div class="list-orders-outer">
<?php if ( count( $tax_list ) > 0 ): ?>
<?php echo APOP_UI::none_registered_alert_msg(); ?>
<?php foreach ( $tax_list as $tax_data ): ?>
<div class="list-orders-inner">
<form action="" method="post">
<?php wp_nonce_field( 'sh_options' ); ?>
<h3><?php echo $tax_data->name; ?></h3>
<ul class="post-order-list">
<?php echo APOP_UI::create_order_list( $tax_data, $tax_key ); ?>
</ul>
<input type="hidden" name="submit_type" value="2">
<p class="submit post-order"><input type="submit" name="Submit"
class="button-primary"
value="変更を保存"/></p>
</form>
</div>
<?php endforeach; ?>
<?php else: ?>
<?php echo APOP_UI::create_none_select_msg( 'カテゴリー' ); ?>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<div class="post-order-box">
<?php foreach ( $tag_lists as $tax_key => $tax_list ) : ?>
<div class="list-orders-outer">
<?php if ( count( $tax_list ) > 0 ): ?>
<?php echo APOP_UI::none_registered_alert_msg(); ?>
<?php foreach ( $tax_list as $tax_data ): ?>
<div class="list-orders-inner">
<form action="" method="post">
<?php wp_nonce_field( 'sh_options' ); ?>
<h3><?php echo $tax_data->name; ?></h3>
<ul class="post-order-list">
<?php echo APOP_UI::create_order_list( $tax_data, $tax_key ); ?>
</ul>
<input type="hidden" name="submit_type" value="3">
<p class="submit post-order"><input type="submit" name="Submit"
class="button-primary"
value="変更を保存"/></p>
</form>
</div>
<?php endforeach; ?>
<?php else: ?>
<?php echo APOP_UI::create_none_select_msg( 'タグ' ); ?>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<div class="post-order-box">
<?php foreach ( $taxonomy_lists as $tax_key => $taxonomy_list ): ?>
<div class="list-orders-outer">
<?php foreach ( $taxonomy_list as $tax_list ) : ?>
<?php if ( count( $taxonomy_list ) > 0 ): ?>
<?php echo APOP_UI::none_registered_alert_msg(); ?>
<?php foreach ( $tax_list as $tax_data ): ?>
<div class="list-orders-inner">
<form action="" method="post">
<?php wp_nonce_field( 'sh_options' ); ?>
<h3><?php echo $tax_data->name; ?></h3>
<ul class="post-order-list">
<?php echo APOP_UI::create_order_list( $tax_data, $tax_key ); ?>
</ul>
<input type="hidden" name="submit_type" value="4">
<p class="submit post-order"><input type="submit" name="Submit"
class="button-primary"
value="変更を保存"/></p>
</form>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php if ( count( $taxonomy_lists['taxonomy'] ) == 0 ): ?>
<?php echo APOP_UI::create_none_select_msg( 'カスタム分類' ); ?>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
</div>
</div>