ARCHIVE POST ORDER PLUS

翻訳対応
検索のカスタムフィールド選択バグ修正
This commit is contained in:
2021-07-11 17:40:23 +09:00
parent ae93196007
commit b8dcf1c44c
16 changed files with 388 additions and 105 deletions
+19 -19
View File
@@ -1,15 +1,15 @@
<?php
$submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
?>
<div class="post-setting-box">
<h2>並べ替え</h2>
<div class="post-setting-box <?php _e( 'apop-lang-en', APOP_DOMAIN ); ?>">
<h2><?php _e( 'Sorting', APOP_DOMAIN ); ?></h2>
<nav class="post-order-nav">
<ul>
<li class="en">最新の投稿</li>
<li>検索</li>
<li>カテゴリー</li>
<li>タグ</li>
<li>カスタム分類</li>
<li class="en"><?php _e( 'Your latest posts', APOP_DOMAIN ); ?></li>
<li><?php _e( 'Search', APOP_DOMAIN ); ?></li>
<li><?php _e( 'Category', APOP_DOMAIN ); ?></li>
<li><?php _e( 'Tag', APOP_DOMAIN ); ?></li>
<li><?php _e( 'Custom taxonomy', APOP_DOMAIN ); ?></li>
</ul>
</nav>
<form action="" method="post">
@@ -20,23 +20,23 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
<div class="post-order-box">
<div class="list-orders-outer">
<div class="list-orders-inner">
<h3>最新の投稿(設定-表示設定ーホームページの表示)</h3>
<h3><?php _e( 'Your latest posts / Settings - Reading Settings', APOP_DOMAIN ); ?></h3>
<?php
$order_target_type = '_apop_normal_order';
$order_target = APOP_UI::get_order_type( $order_target_type );
?>
<?php include APOP_PLUGIN_PATH . 'template/order_parts_menu.php'; ?>
<hr>
<p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<p><?php _e( 'Click "Save Changes" to register the sort.', APOP_DOMAIN ); ?></p>
<div class="sort_box">
<div class="enable-box">
<h4>有効</h4>
<h4><?php _e( 'Enabled', APOP_DOMAIN ); ?></h4>
<ul class="post-order-list search-normal-sort">
<?php APOP_UI::create_search_normal_list( 'normal' ); ?>
</ul>
</div>
<div class="disable-box">
<h4>無効</h4>
<h4><?php _e( 'Disabled', APOP_DOMAIN ); ?></h4>
<ul class="disable-normal-list"></ul>
</div>
</div>
@@ -51,23 +51,23 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
<div class="post-order-box">
<div class="list-orders-outer">
<div class="list-orders-inner">
<h3>検索</h3>
<h3><?php _e( 'Search', APOP_DOMAIN ); ?></h3>
<?php
$order_target_type = '_apop_search_order';
$order_target = APOP_UI::get_order_type( $order_target_type );
?>
<?php include APOP_PLUGIN_PATH . 'template/order_parts_menu.php'; ?>
<hr>
<p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<p><?php _e( 'Click "Save Changes" to register the sort.', APOP_DOMAIN ); ?></p>
<div class="sort_box">
<div class="enable-box">
<h4>有効</h4>
<h4><?php _e( 'Enabled', APOP_DOMAIN ); ?></h4>
<ul class="post-order-list search-normal-sort">
<?php APOP_UI::create_search_normal_list( 'search' ); ?>
</ul>
</div>
<div class="disable-box">
<h4>無効</h4>
<h4><?php _e( 'Disabled', APOP_DOMAIN ); ?></h4>
<ul class="disable-normal-list"></ul>
</div>
</div>
@@ -83,7 +83,7 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
<div class="tax_sort_box">
<?php
$tax_lists = array( 'category' => APOP_UI::get_cat_tag_list( 'cat', 'category' ) );
$tax_title_text = 'カテゴリー';
$tax_title_text = __('Category', APOP_DOMAIN);
?>
<?php include APOP_PLUGIN_PATH . 'template/order_parts_taxonomy.php'; ?>
</div>
@@ -92,7 +92,7 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
<div class="tax_sort_box">
<?php
$tax_lists = array( 'tag_id' => APOP_UI::get_cat_tag_list( 'tag', 'post_tag' ) );
$tax_title_text = 'タグ';
$tax_title_text = __('Tag', APOP_DOMAIN);
?>
<?php include APOP_PLUGIN_PATH . 'template/order_parts_taxonomy.php'; ?>
</div>
@@ -101,12 +101,12 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
<div class="tax_sort_box">
<?php
$tax_lists = array( 'taxonomy' => APOP_UI::get_cat_tag_list( 'tax', 'taxonomy' ) );
$tax_title_text = 'カスタム分類';
$tax_title_text = __('Custom taxonomy', APOP_DOMAIN);
?>
<?php include APOP_PLUGIN_PATH . 'template/order_parts_taxonomy.php'; ?>
</div>
</div>
</div>
<p class="apop-submit"><input type="submit" name="submit" class="button-primary" value="変更を保存"/></p>
<p class="apop-submit"><input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save changes', APOP_DOMAIN ); ?>"/></p>
</form>
</div>
+2 -2
View File
@@ -3,9 +3,9 @@
data-order_target="<?php echo esc_attr( $order_target ); ?>">
<li><label>
<input class="sort_menu" type="radio" name="<?php echo esc_attr( $order_target_type ); ?>"
value="1"<?php checked( $order_target, 1 ); ?>>標準+カスタムフィールドソート</label></li>
value="1"<?php checked( $order_target, 1 ); ?>><?php _e('Standard + custom field sort', APOP_DOMAIN); ?></label></li>
<li><label>
<input class="sort_menu" type="radio" name="<?php echo esc_attr( $order_target_type ); ?>"
value="2"<?php checked( $order_target, 2 ); ?>>ドラッグソート</label></li>
value="2"<?php checked( $order_target, 2 ); ?>><?php _e('Drag sort', APOP_DOMAIN); ?></label></li>
</ul>
<?php endif;
+9 -7
View File
@@ -19,19 +19,21 @@
<label>
<input class="sort_menu" type="radio"
name="_apop_tax_sort_type[<?php echo esc_attr( $tax_data->term_id ); ?>]"
value="2"<?php checked( $order_target, 2 ); ?>>標準+カスタムフィールドソート</label>
value="2"<?php checked( $order_target, 2 ); ?>><?php _e( 'Standard + custom field sort', APOP_DOMAIN ); ?>
</label>
</li>
<li>
<label>
<input class="sort_menu" type="radio"
name="_apop_tax_sort_type[<?php echo esc_attr( $tax_data->term_id ); ?>]"
value="1"<?php checked( $order_target, 1 ); ?>>ドラッグソート</label>
value="1"<?php checked( $order_target, 1 ); ?>><?php _e( 'Drag sort', APOP_DOMAIN ); ?>
</label>
</li>
</ul>
<div class="sort_box">
<hr>
<p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<p><?php _e( 'Click "Save Changes" to register the sort.', APOP_DOMAIN ); ?></p>
<ul class="post-order-list drag-sort">
<?php echo APOP_UI::create_order_list( $tax_data, $tax_key ); ?>
</ul>
@@ -39,22 +41,22 @@
<div class="sort_box">
<hr>
<p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<p><?php _e( 'Click "Save Changes" to register the sort.', APOP_DOMAIN ); ?></p>
<div class="enable-box">
<h4>有効</h4>
<h4><?php _e( 'Enabled', APOP_DOMAIN ); ?></h4>
<ul class="post-order-list search-normal-sort">
<?php APOP_UI::create_search_normal_list( 'tax', $tax_data->term_id ); ?>
</ul>
</div>
<div class="disable-box">
<h4>無効</h4>
<h4><?php _e( 'Disabled', APOP_DOMAIN ); ?></h4>
<ul class="disable-normal-list"></ul>
</div>
</div>
</div>
<?php endforeach; ?>
<?php else: ?>
<p class="no-registered-exp">並べ替えをカスタマイズする<?php echo esc_html( $tax_title_text ); ?>は選択されていません。</p>
<p class="no-registered-exp"><?php _e( 'No', APOP_DOMAIN ); ?> <?php echo esc_html( $tax_title_text . ' ' ); ?><?php _e( 'has been selected.', APOP_DOMAIN ); ?></p>
<?php endif; ?>
</div>
<?php endforeach; ?>
+14 -11
View File
@@ -1,29 +1,31 @@
<div class="post-setting-box">
<form action="" method="post">
<?php wp_nonce_field( 'sh_options' ); ?>
<h2>設定</h2>
<h2><?php _e( 'Settings', APOP_DOMAIN ); ?></h2>
<table class="form-table apop-form-table">
<tr>
<th scope="row">全体設定</th>
<th scope="row"><?php _e( 'Global settings', APOP_DOMAIN ); ?></th>
<td>
<dl class="apop-setting-list">
<dt>1ページ表示件数</dt>
<dt><?php _e( 'Displayed per page', APOP_DOMAIN ); ?></dt>
<dd><?php $per_page_data = APOP_UI::create_cat_per_page( get_option( '_apop_per_page' ), 'search' ); ?>
<ul>
<li>
<label>
<input class="per_page_search" type="radio" name="_apop_per_page[search]"
value="default"<?php checked( $per_page_data['_per_page'], 'default' ); ?>>表示設定に従う(<?php echo esc_html( get_option( 'posts_per_page' ) ); ?>
件)</label>
value="default"<?php checked( $per_page_data['_per_page'], 'default' ); ?>><?php _e( 'Follow display settings', APOP_DOMAIN ); ?>
<?php echo esc_html( get_option( 'posts_per_page' ) ); ?>
<?php _e( 'Posts', APOP_DOMAIN ); ?></label>
</li>
<li><label>
<input class="per_page_search" type="radio" name="_apop_per_page[search]"
value="-1"<?php checked( $per_page_data['_per_page'], '-1' ); ?>>全件</label>
value="-1"<?php checked( $per_page_data['_per_page'], '-1' ); ?>><?php _e( 'All posts', APOP_DOMAIN ); ?>
</label>
</li>
<li>
<label><input class="per_page_search" type="radio"
name="_apop_per_page[search]"
value="" <?php echo esc_attr( $per_page_data['_checked'] ); ?>>表示数設定
value="" <?php echo esc_attr( $per_page_data['_checked'] ); ?>><?php _e( 'Set the number posts', APOP_DOMAIN ); ?>
<input class="per_page_search_input" type="text"
name="_apop_per_page[search]"
value="<?php echo esc_attr( $per_page_data['_per_page_num'] ); ?>"
@@ -35,10 +37,11 @@
</dl>
</td>
</tr>
<?php APOP_UI::disp_tax_setting( 'category', 'カテゴリー', '_apop_cat_order' ); ?>
<?php APOP_UI::disp_tax_setting( 'post_tag', 'タグ', '_apop_tag_order' ); ?>
<?php APOP_UI::disp_tax_setting( 'taxonomy', 'カスタム分類', '_apop_tax_order' ); ?>
<?php APOP_UI::disp_tax_setting( 'category', __( 'Categories setting', APOP_DOMAIN ), '_apop_cat_order' ); ?>
<?php APOP_UI::disp_tax_setting( 'post_tag', __( 'Tags setting', APOP_DOMAIN ), '_apop_tag_order' ); ?>
<?php APOP_UI::disp_tax_setting( 'taxonomy', __( 'Custom Taxonomies setting', APOP_DOMAIN ), '_apop_tax_order' ); ?>
</table>
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/>
<p class="submit"><input type="submit" name="Submit" class="button-primary"
value="<?php _e( 'Save changes', APOP_DOMAIN ); ?>"/>
</form>
</div>
+6 -6
View File
@@ -1,6 +1,6 @@
<?php if ( isset( $tax_data, $order_name, $order_tax ) ): ?>
<dl class="apop-setting-list">
<dt>対象</dt>
<dt><?php _e('Targets', APOP_DOMAIN); ?></dt>
<dd>
<ul class="order-setting-list">
<?php foreach ( $tax_data as $tax_datum ): ?>
@@ -28,23 +28,23 @@
<label>
<input class="per_page_cat" type="radio"
name="_apop_per_page[<?php echo esc_attr( $order_tax ); ?>][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value="default"<?php checked( $per_page_data['_per_page'], 'default' ); ?>>表示設定に従う<?php echo esc_html( get_option( 'posts_per_page' ) ); ?>
</label>
value="default"<?php checked( $per_page_data['_per_page'], 'default' ); ?>><?php _e( 'Follow display settings', APOP_DOMAIN ); ?><?php echo esc_html( get_option( 'posts_per_page' ) ); ?>
<?php _e( 'Posts', APOP_DOMAIN ); ?></label>
</li>
<li><label>
<input class="per_page_cat" type="radio"
name="_apop_per_page[<?php echo esc_attr( $order_tax ); ?>][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value="all"<?php checked( $per_page_data['_per_page'], 'all' ); ?>>全体設定に従う</label>
value="all"<?php checked( $per_page_data['_per_page'], 'all' ); ?>><?php _e( 'Follow global settings', APOP_DOMAIN ); ?></label>
</li>
<li><label>
<input class="per_page_cat" type="radio"
name="_apop_per_page[<?php echo esc_attr( $order_tax ); ?>][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value="-1"<?php checked( $per_page_data['_per_page'], '-1' ); ?>>全件</label>
value="-1"<?php checked( $per_page_data['_per_page'], '-1' ); ?>><?php _e( 'All posts', APOP_DOMAIN ); ?></label>
</li>
<li class="set_number_list">
<label><input class="per_page_cat set_number" type="radio"
name="_apop_per_page[<?php echo esc_attr( $order_tax ); ?>][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value=""<?php echo esc_attr( $per_page_data['_checked'] ); ?>>表示数設定
value=""<?php echo esc_attr( $per_page_data['_checked'] ); ?>><?php _e( 'Set the number posts', APOP_DOMAIN ); ?>
<input class="per_page_cat_input" type="text"
name="_apop_per_page[<?php echo esc_attr( $order_tax ); ?>][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value="<?php echo esc_attr( $per_page_data['_per_page_num'] ); ?>"
+1 -1
View File
@@ -15,7 +15,7 @@
} else {
$custom_field_prefix = '';
$disabled = ' disabled';
$read_only_class = ' ※カスタムフィールドから変更してください';
$read_only_class = __( '* Change from custom field', APOP_DOMAIN );
}
?>
<li>
+2 -1
View File
@@ -1 +1,2 @@
<div id="settings_updated" class="updated notice is-dismissible"><p><strong>設定を保存しました</strong></p></div>
<div id="settings_updated" class="updated notice is-dismissible"><p>
<strong><?php _e( 'Saved the setting', APOP_DOMAIN ); ?></strong></p></div>