WP PLUGIN ソート対象拡張

・通常、検索、タクソノミーにソート用カスタムフィールドの設定入力欄を追加
・通常と検索にカスタムフィールド検索処理を実装
・タクソノミーに通常+カスタムフィールドのメニューを追加
・タクソノミーに通常+カスタムフィールドとドラッグソートの切り替え用ラジオボタンを追加
This commit is contained in:
2021-05-09 18:38:56 +09:00
parent 3dc1fc30fa
commit f07c318f93
9 changed files with 317 additions and 178 deletions
+61
View File
@@ -0,0 +1,61 @@
<?php if ( isset( $tax_lists, $tax_title_text, $submit_type_number ) ): ?>
<?php foreach ( $tax_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>
<?php
$order_target_data = get_option( '_apop_tax_sort_type' );
if ( isset( $order_target_data[ $tax_data->term_id ] ) ) {
$order_target = $order_target_data[ $tax_data->term_id ];
} else {
$order_target = 1;
}
?>
<ul class="sort_menu_list"
data-order_target="<?php echo $order_target; ?>">
<li>
<label>
<input class="sort_menu" type="radio"
name="_apop_tax_sort_type[<?php echo $tax_data->term_id; ?>]"
value="1"<?php checked( $order_target, 1 ); ?>>ドラッグソート</label>
</li>
<li>
<label>
<input class="sort_menu" type="radio"
name="_apop_tax_sort_type[<?php echo $tax_data->term_id; ?>]"
value="2"<?php checked( $order_target, 2 ); ?>>標準+カスタムフィールドソート</label>
</li>
</ul>
<div class="sort_box">
<ul class="post-order-list">
<?php echo APOP_UI::create_order_list( $tax_data, $tax_key ); ?>
</ul>
</div>
<div class="sort_box">
<?php list( $list, $alert, $field_metakey_input ) = APOP_UI::create_search_normal_list( 'tax', $tax_data->term_id ); ?>
<?php echo $alert; ?>
<ul class="post-order-list search_normal_sort">
<?php echo $list; ?>
</ul>
<?php echo $field_metakey_input; ?>
</div>
<input type="hidden" name="submit_type" value="<?php echo $submit_type_number; ?>">
<p class="submit post-order"><input type="submit" name="Submit"
class="button-primary"
value="変更を保存"/></p>
<input type="hidden" name="sort_type[cat]" value="1">
</form>
</div>
<?php endforeach; ?>
<?php else: ?>
<?php echo APOP_UI::create_none_select_msg( $tax_title_text ); ?>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif;