WP PLUGIN 申請指摘事項の再修正
・echoのエスケープ ・メソッドの変数をエスケープ
This commit is contained in:
@@ -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[] = '<li class="product-list' . $no_order . '">' . self::crate_non_registerd_mark( $no_order ) . '
|
||||
<span class="sort-num-label">' . $order . '</span>' . $post_data->post_title . '
|
||||
<input type="hidden" class="list_order" name="_apop_post_' . $key . '[post_sort][' . $post_data->ID . ']" value="' . $order . '">
|
||||
$list[] = '<li class="product-list' . esc_html( $no_order ) . '">' . esc_html( self::crate_non_registerd_mark( $no_order ) ) . '
|
||||
<span class="sort-num-label">' . esc_html( $order ) . '</span>' . esc_html( $post_data->post_title ) . '
|
||||
<input type="hidden" class="list_order" name="_apop_post_' . esc_html( $key ) . '[post_sort][' . esc_html( $post_data->ID ) . ']" value="' . esc_html( $order ) . '">
|
||||
</li>';
|
||||
}
|
||||
|
||||
@@ -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[] = '
|
||||
<li class="product-list' . $no_order . '">' . self::crate_non_registerd_mark( $no_order ) . '<span class="sort-num-label">' . $sort_num . '</span>' . get_the_title( $target_post->ID ) . '
|
||||
<li class="product-list' . esc_html( $no_order ) . '">' . esc_html( self::crate_non_registerd_mark( $no_order ) )
|
||||
. '<span class="sort-num-label">' . esc_html( $sort_num ) . '</span>' . get_the_title( $target_post->ID ) . '
|
||||
<input type="hidden" class="list_order"
|
||||
name="_apop_post_' . self::create_post_sort_key( $tax_data->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 ) . '">
|
||||
</li>';
|
||||
}
|
||||
|
||||
@@ -243,7 +244,7 @@ value="' . $sort_num . '">
|
||||
if ( count( $tax_data ) > 0 ) {
|
||||
$order_name = $order_name;
|
||||
$order_tax = $key == 'post_tag' ? 'tag' : $key;
|
||||
echo '<tr><th scope="row">' . $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>';
|
||||
}
|
||||
@@ -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[] = '<li class="product-list' . $no_order_class . '">
|
||||
<div class="product-list-type-label"><b>' . $target_values[ $target_key ] . '</b></div>
|
||||
$list[] = '<li class="product-list' . esc_html( $no_order_class ) . '">
|
||||
<div class="product-list-type-label"><b>' . esc_html( $target_values[ $target_key ] ) . '</b></div>
|
||||
<div class="product-list-sort-type">
|
||||
<label>
|
||||
<input type="hidden" name="_' . $name_key . '[' . $target_key . '][use]" value="0"' . self::set_search_normal_checked( $use, 0 ) . '>
|
||||
<span class="en_dis_label">有効</span>:<input class="' . $target_key_check_class . '" type="checkbox" name="_' . $name_key . '[' . $target_key . '][use]" value="1"' . self::set_search_normal_checked( $use, 1 ) . '>
|
||||
<input type="hidden" name="' . esc_html( $name_use_key ) . '"
|
||||
value="0"' . esc_html( self::set_search_normal_checked( $use, 0 ) ) . '>
|
||||
<span class="en_dis_label">有効</span>:<input class="' . esc_html( $target_key_check_class ) . '"
|
||||
type="checkbox" name="' . esc_html( $name_use_key ) . '" value="1"' . esc_html( self::set_search_normal_checked( $use, 1 ) ) . '>
|
||||
</label>
|
||||
<label>
|
||||
<input class="order_param" type="radio"
|
||||
name="_' . $name_key . '[' . $target_key . '][sort]"
|
||||
value="1"' . self::set_search_normal_checked( $sort, 1 ) . '>昇順</label>
|
||||
name="' . esc_html( $name_sort_key ) . '"
|
||||
value="1"' . esc_html( self::set_search_normal_checked( $sort, 1 ) ) . '>昇順</label>
|
||||
<label>
|
||||
<input class="order_param" type="radio"
|
||||
name="_' . $name_key . '[' . $target_key . '][sort]"
|
||||
value="2"' . self::set_search_normal_checked( $sort, 2 ) . '>降順</label>
|
||||
name="' . esc_html( $name_sort_key ) . '"
|
||||
value="2"' . esc_html( self::set_search_normal_checked( $sort, 2 ) ) . '>降順</label>
|
||||
' . $field_metakey_input . '
|
||||
</div>
|
||||
</li>';
|
||||
@@ -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 '<div class="sort_custom_field">
|
||||
<div class="sort_custom_field_inner"><div class="sort_custom_field_inner_label">カスタムフィールドキー:</div>
|
||||
<input type="text" class="custom_field_key" name="_' . $name_key . '[' . $target_key . '][field][meta_key]" value="' . $meta_key . '">
|
||||
<input type="text" class="custom_field_key" name="' . esc_html( $name_meta_key ) . '" value="' . esc_html( $meta_key ) . '">
|
||||
</div>
|
||||
<div class="sort_custom_field_inner">
|
||||
<div class="sort_custom_field_inner_label">値タイプ:</div>
|
||||
<label><input type="radio"
|
||||
class="custom_field_meta_value"
|
||||
name="_' . $name_key . '[' . $target_key . '][field][value_type]"
|
||||
value="meta_value"' . self::set_search_normal_checked( $value_type, 'meta_value' ) . '>テキスト</label>
|
||||
name="' . esc_html( $name_value_type ) . '"
|
||||
value="meta_value"' . esc_html( self::set_search_normal_checked( $value_type, 'meta_value' ) ) . '>テキスト</label>
|
||||
<label><input type="radio"
|
||||
class="custom_field_meta_value"
|
||||
name="_' . $name_key . '[' . $target_key . '][field][value_type]"
|
||||
value="meta_value_num"' . self::set_search_normal_checked( $value_type, 'meta_value_num' ) . '>数値</label>
|
||||
name="' . esc_html( $name_value_type ) . '"
|
||||
value="meta_value_num"' . esc_html( self::set_search_normal_checked( $value_type, 'meta_value_num' ) ) . '>数値</label>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
@@ -358,7 +366,7 @@ value="meta_value_num"' . self::set_search_normal_checked( $value_type, 'meta_va
|
||||
$param = array(
|
||||
'use' => 0,
|
||||
'sort' => 2,
|
||||
'alert' => '<p>並べ替えを登録するには「変更を保存」をクリックしてください。</p>',
|
||||
'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'] ? '<p>並べ替えを登録するには「変更を保存」をクリックしてください。</p>' : '',
|
||||
'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 '<p class="no_registered_exp">並べ替えをカスタマイズする' . $str . 'は選択されていません。</p>';
|
||||
}
|
||||
|
||||
public static function none_registered_alert_msg(): string {
|
||||
return '<div class="no_registered_exp">■は未登録項目です。ドラッグして並び順を変更後に「変更を保存」をクリックしてください。</div>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user