diff --git a/class/class.apop.apop_ui.php b/class/class.apop.apop_ui.php
index f693ec0..de76817 100644
--- a/class/class.apop.apop_ui.php
+++ b/class/class.apop.apop_ui.php
@@ -25,9 +25,9 @@ if ( ! class_exists( 'APOP_UI' ) ) {
foreach ( $posts_data as $i => $post_data ) {
$order = $i + 1;
$no_order = self::is_sort_post_registered( $post_data->ID, $meta_key ) ? '' : ' no_order';
- $list[] = '
' . self::crate_non_registerd_mark( $no_order ) . '
-' . $order . '' . $post_data->post_title . '
-
+ $list[] = '' . esc_html( self::crate_non_registerd_mark( $no_order ) ) . '
+' . esc_html( $order ) . '' . esc_html( $post_data->post_title ) . '
+
';
}
@@ -142,10 +142,11 @@ if ( ! class_exists( 'APOP_UI' ) ) {
$sort_num = $key + 1;
$no_order = self::is_sort_post_registered( $target_post->ID, $return_data['meta_key'] ) ? '' : ' no_order';
$list[] = '
-' . self::crate_non_registerd_mark( $no_order ) . '' . $sort_num . '' . get_the_title( $target_post->ID ) . '
+' . esc_html( self::crate_non_registerd_mark( $no_order ) )
+ . '' . esc_html( $sort_num ) . '' . get_the_title( $target_post->ID ) . '
taxonomy, $tax_key ) . '[post_sort][' . $tax_data->term_id . '][' . $target_post->ID . ']"
-value="' . $sort_num . '">
+name="_apop_post_' . esc_html( self::create_post_sort_key( $tax_data->taxonomy, $tax_key ) ) . '[post_sort][' . esc_html( $tax_data->term_id ) . '][' . esc_html( $target_post->ID ) . ']"
+value="' . esc_html( $sort_num ) . '">
';
}
@@ -243,7 +244,7 @@ value="' . $sort_num . '">
if ( count( $tax_data ) > 0 ) {
$order_name = $order_name;
$order_tax = $key == 'post_tag' ? 'tag' : $key;
- echo '| ' . $title . '設定 | ';
+ echo ' |
|---|
| ' . esc_html( $title ) . '設定 | ';
include APOP_PLUGIN_PATH . 'template/setting_parts_taxonomy.php';
echo ' |
';
}
@@ -300,6 +301,8 @@ value="' . $sort_num . '">
$alert = $cnv_order_params['alert'];
$no_order_class = $cnv_order_params['no_order_class'];
$field_metakey_input = '';
+ $name_use_key = '_' . $name_key . '[' . $target_key . '][use]';
+ $name_sort_key = '_' . $name_key . '[' . $target_key . '][ sort ]';
if ( strpos( $target_key, 'custom_field' ) !== false ) {
$meta_key = $cnv_order_params[ $target_key ]['meta_key'];
$value_type = $cnv_order_params[ $target_key ]['value_type'];
@@ -308,21 +311,23 @@ value="' . $sort_num . '">
} else {
$target_key_check_class = 'sort_' . $target_key . '_check';
}
- $list[] = '
- ' . $target_values[ $target_key ] . '
+ $list[] = '
+ ' . esc_html( $target_values[ $target_key ] ) . '
+ name="' . esc_html( $name_sort_key ) . '"
+ value="1"' . esc_html( self::set_search_normal_checked( $sort, 1 ) ) . '>昇順
+ name="' . esc_html( $name_sort_key ) . '"
+ value="2"' . esc_html( self::set_search_normal_checked( $sort, 2 ) ) . '>降順
' . $field_metakey_input . '
';
@@ -330,25 +335,28 @@ value="' . $sort_num . '">
return array(
implode( PHP_EOL, $list ),
- $alert
+ $alert,
);
}
private static function create_custom_field_sort_type( $name_key, $target_key, $meta_key, $value_type ): string {
+ $name_meta_key = '_' . $name_key . '[' . $target_key . '][field][meta_key]';
+ $name_value_type = '_' . $name_key . '[' . $target_key . '][field][value_type]';
+
return '';
}
@@ -358,7 +366,7 @@ value="meta_value_num"' . self::set_search_normal_checked( $value_type, 'meta_va
$param = array(
'use' => 0,
'sort' => 2,
- 'alert' => '並べ替えを登録するには「変更を保存」をクリックしてください。
',
+ 'alert' => '並べ替えを登録するには「変更を保存」をクリックしてください。',
'no_order_class' => ' no_order',
);
if ( strpos( $target_key, 'custom_field' ) !== false ) {
@@ -372,7 +380,7 @@ value="meta_value_num"' . self::set_search_normal_checked( $value_type, 'meta_va
$param = array(
'use' => $order_param[ $target_key ]['use'] ?? 0,
'sort' => $order_param[ $target_key ]['sort'] ?? 2,
- 'alert' => ! $order_param[ $target_key ]['use'] ? '並べ替えを登録するには「変更を保存」をクリックしてください。
' : '',
+ 'alert' => ! $order_param[ $target_key ]['use'] ? '並べ替えを登録するには「変更を保存」をクリックしてください。' : '',
'no_order_class' => ! $order_param[ $target_key ]['use'] ? ' no_order' : '',
);
if ( strpos( $target_key, 'custom_field' ) !== false ) {
@@ -446,13 +454,5 @@ value="meta_value_num"' . self::set_search_normal_checked( $value_type, 'meta_va
}
}
- public static function create_none_select_msg( $str ): string {
- return '並べ替えをカスタマイズする' . $str . 'は選択されていません。
';
- }
-
- public static function none_registered_alert_msg(): string {
- return '■は未登録項目です。ドラッグして並び順を変更後に「変更を保存」をクリックしてください。
';
- }
-
}
}
\ No newline at end of file
diff --git a/template/order.php b/template/order.php
index 4931a1a..134dfae 100644
--- a/template/order.php
+++ b/template/order.php
@@ -15,7 +15,8 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );