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
+6 -5
View File
@@ -30,7 +30,7 @@ if ( ! class_exists( 'APOP_POST' ) ) {
public function add_meta_fields() {
$target_posts = $this->set_post_types();
foreach ( $target_posts as $target_post ) {
add_meta_box( 'apo_custom_fields', 'APO+カスタムフィールド', array(
add_meta_box( 'apo_custom_fields', __( 'APO + custom field settings', APOP_DOMAIN ), array(
$this,
'insert_meta_fields'
), $target_post, 'normal' );
@@ -43,16 +43,17 @@ if ( ! class_exists( 'APOP_POST' ) ) {
$this->create_order_field_data( get_option( '_apop_normal_order_param' ), 'normal' );
}
//検索ソート
if ( get_option( '_apop_tax_sort_type' ) == '1' ) {
if ( get_option( '_apop_search_order' ) == '1' ) {
$this->create_order_field_data( get_option( '_apop_search_order_param' ), 'search' );
}
//カテゴリー、タグ、カスタム分類
$this->create_order_tax_field_data( get_option( '_apop_tax_order_param' ) );
$this->labels = array(
'normal' => '最新の投稿',
'search' => '検索',
'tax' => 'カテゴリー、タグ、カスタム分類',
'normal' => __('Your latest posts', APOP_DOMAIN),
'search' => __('Search', APOP_DOMAIN),
'tax' => __('Category, Tag, Custom Taxonomy', APOP_DOMAIN),
);
require_once self::TEMPLATE_DIR . 'setting_post_custom_field.php';
+16 -16
View File
@@ -249,7 +249,7 @@ value="' . esc_html( $sort_num ) . '">
if ( count( $tax_data ) > 0 ) {
$order_name = $order_name;
$order_tax = $key == 'post_tag' ? 'tag' : $key;
echo '<tr><th scope="row">' . esc_html( $title ) . '設定</th><td>';
echo '<tr><th scope="row">' . esc_html( $title ) . '</th><td>';
include APOP_PLUGIN_PATH . 'template/setting_parts_taxonomy.php';
echo '</td></tr>';
}
@@ -289,14 +289,14 @@ value="' . esc_html( $sort_num ) . '">
}
$target_keys = self::set_search_normal_target_keys( $order_param );
$target_values = array(
'date' => '登録日',
'title' => 'タイトル',
'date' => __( 'Published', APOP_DOMAIN ),
'title' => __( 'Post Title', APOP_DOMAIN ),
'ID' => 'ID',
'modified' => '更新日',
'custom_field' => 'カスタムフィールド1',
'custom_field_2' => 'カスタムフィールド2',
'custom_field_3' => 'カスタムフィールド3',
'custom_field_4' => 'カスタムフィールド4',
'modified' => __( 'Modified', APOP_DOMAIN ),
'custom_field' => __( 'Custom filed 1', APOP_DOMAIN ),
'custom_field_2' => __( 'Custom filed 2', APOP_DOMAIN ),
'custom_field_3' => __( 'Custom filed 3', APOP_DOMAIN ),
'custom_field_4' => __( 'Custom filed 4', APOP_DOMAIN ),
);
$list = array();
foreach ( $target_keys as $target_key ) {
@@ -318,17 +318,17 @@ value="' . esc_html( $sort_num ) . '">
<label>
<input type="hidden" name="' . esc_attr( $name_use_key ) . '"
value="0"' . esc_attr( self::set_search_normal_checked( $use, 0 ) ) . '>
<span class="en_dis_label">有効</span><input class="' . esc_html( $target_key_check_class ) . '"
<span class="en_dis_label">' . __( 'Enabled', APOP_DOMAIN ) . '</span><input class="' . esc_html( $target_key_check_class ) . '"
type="checkbox" name="' . esc_attr( $name_use_key ) . '" value="1"' . esc_attr( self::set_search_normal_checked( $use, 1 ) ) . '>
</label>
<label>
<input class="order_param" type="radio"
name="' . esc_attr( $name_sort_key ) . '"
value="1"' . esc_attr( self::set_search_normal_checked( $sort, 1 ) ) . '>昇順</label>
value="1"' . esc_attr( self::set_search_normal_checked( $sort, 1 ) ) . '>' . __( 'Asc', APOP_DOMAIN ) . '</label>
<label>
<input class="order_param" type="radio"
name="' . esc_attr( $name_sort_key ) . '"
value="2"' . esc_attr( self::set_search_normal_checked( $sort, 2 ) ) . '>降順</label>';
value="2"' . esc_attr( self::set_search_normal_checked( $sort, 2 ) ) . '>' . __( 'Desc', APOP_DOMAIN ) . '</label>';
if ( strpos( $target_key, 'custom_field' ) !== false ) {
self::create_custom_field_sort_type( $name_key, $target_key, $cnv_order_params );
@@ -355,28 +355,28 @@ value="' . esc_html( $sort_num ) . '">
<input type="radio"
class="custom-field-type"
name="' . esc_attr( $name_custom_field_type ) . '"
value="1"' . esc_attr( self::set_search_normal_checked( $custom_field_type, '1' ) ) . '>選択</label>
value="1"' . esc_attr( self::set_search_normal_checked( $custom_field_type, '1' ) ) . '>' . __( 'Select', APOP_DOMAIN ) . '</label>
<label>
<input type="radio"
class="custom-field-type"
name="' . esc_attr( $name_custom_field_type ) . '"
value="2"' . esc_attr( self::set_search_normal_checked( $custom_field_type, '2' ) ) . '>追加</label>
value="2"' . esc_attr( self::set_search_normal_checked( $custom_field_type, '2' ) ) . '>' . __( 'Add', APOP_DOMAIN ) . '</label>
</div>';
echo '<input type="text" class="select-custom-field-input custom_field_key_select" name="' . esc_attr( $name_meta_key ) . '" . value="' . esc_attr( $custom_field_val_1 ) . '" required>
<input type="text" class="custom_field_key" name="' . esc_attr( $name_meta_key ) . '" value="' . esc_attr( $custom_field_val_2 ) . '" required>
</div>
<div class="custom-field-select-alert"></div>
<div class="sort-custom-field-inner">
<div class="sort-custom-field-inner-label">値タイプ</div>
<div class="sort-custom-field-inner-label">' . __( 'Type', APOP_DOMAIN ) . '</div>
<label class="sort-custom-field-text-label">
<input type="radio"
class="custom-field-meta-value"
name="' . esc_attr( $name_value_type ) . '"
value="meta_value"' . esc_attr( self::set_search_normal_checked( $value_type, 'meta_value' ) ) . '>テキスト</label>
value="meta_value"' . esc_attr( self::set_search_normal_checked( $value_type, 'meta_value' ) ) . '>' . __( 'Text', APOP_DOMAIN ) . '</label>
<label><input type="radio"
class="custom-field-meta-value"
name="' . esc_attr( $name_value_type ) . '"
value="meta_value_num"' . esc_attr( self::set_search_normal_checked( $value_type, 'meta_value_num' ) ) . '>数値</label>
value="meta_value_num"' . esc_attr( self::set_search_normal_checked( $value_type, 'meta_value_num' ) ) . '>' . __( 'Number', APOP_DOMAIN ) . '</label>
</div>
</div>';
}
+3 -2
View File
@@ -29,10 +29,11 @@ if ( ! class_exists( 'APOP' ) ) {
array( $this, 'display_setting_page' ),
''
);
//
add_submenu_page(
'apop_post_sort', // parent_slug
'Sort taxonomy', // page_title
'表示件数・対象設定', // menu_title
__( 'Display number / target setting', APOP_DOMAIN ), // menu_title
'administrator', // capability
'apop_post_sort', // menu_slug
array( $this, 'display_setting_page' ) // function
@@ -40,7 +41,7 @@ if ( ! class_exists( 'APOP' ) ) {
add_submenu_page(
'apop_post_sort', // parent_slug
'Select taxonomy', // page_title
'並べ替え', // menu_title
__( 'Sorting', APOP_DOMAIN ), // menu_title
'administrator', // capability
'apop_post_sort_setting', // menu_slug
array( $this, 'show_option_page' ) // function