WP PLUGIN エスケープ処理の修正

・echo時にエスケープするようメソッド修正
・HTMLタグないのエスケープをesc_attr()に変更
This commit is contained in:
2021-06-19 09:18:48 +09:00
parent f9fe860c81
commit ff1dcdc5f4
8 changed files with 144 additions and 148 deletions
+11
View File
@@ -38,9 +38,13 @@ if ( ! class_exists( 'APOP_POST' ) ) {
public function insert_meta_fields() { public function insert_meta_fields() {
//通常ソート //通常ソート
if ( get_option( '_apop_normal_order' ) == '1' ) {
$this->create_order_field_data( get_option( '_apop_normal_order_param' ), 'normal' ); $this->create_order_field_data( get_option( '_apop_normal_order_param' ), 'normal' );
}
//検索ソート //検索ソート
if ( get_option( '_apop_tax_sort_type' ) == '1' ) {
$this->create_order_field_data( get_option( '_apop_search_order_param' ), 'search' ); $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->create_order_tax_field_data( get_option( '_apop_tax_order_param' ) );
@@ -75,7 +79,14 @@ if ( ! class_exists( 'APOP_POST' ) ) {
private function create_order_tax_field_data( $param, $update = false ) { private function create_order_tax_field_data( $param, $update = false ) {
$term_ids = $this->create_post_term_ids(); $term_ids = $this->create_post_term_ids();
$sort_types = get_option( '_apop_tax_sort_type' );
foreach ( $term_ids as $term_id ) { foreach ( $term_ids as $term_id ) {
if(!isset($sort_types[$term_id])){
continue;
}
if($sort_types[$term_id] == '1'){
break;
}
foreach ( $this->order_param_keys as $order_param_key ) { foreach ( $this->order_param_keys as $order_param_key ) {
if ( isset( $param[ $term_id ][ $order_param_key ]['field']['meta_key'] ) && if ( isset( $param[ $term_id ][ $order_param_key ]['field']['meta_key'] ) &&
! empty( $param[ $term_id ][ $order_param_key ]['field']['meta_key'] ) ) { ! empty( $param[ $term_id ][ $order_param_key ]['field']['meta_key'] ) ) {
+50 -55
View File
@@ -15,9 +15,7 @@ if ( ! class_exists( 'APOP_UI' ) ) {
return $type_data; return $type_data;
} }
public static function get_all_search_normal_posts( public static function get_all_search_normal_posts( $key ) {
$key
): string {
$meta_key = '_apop_post_' . $key; $meta_key = '_apop_post_' . $key;
$args = self::create_search_normal_args( $meta_key ); $args = self::create_search_normal_args( $meta_key );
$posts_data = get_posts( $args ); $posts_data = get_posts( $args );
@@ -25,13 +23,14 @@ if ( ! class_exists( 'APOP_UI' ) ) {
foreach ( $posts_data as $i => $post_data ) { foreach ( $posts_data as $i => $post_data ) {
$order = $i + 1; $order = $i + 1;
$no_order = self::is_sort_post_registered( $post_data->ID, $meta_key ) ? '' : ' no_order'; $no_order = self::is_sort_post_registered( $post_data->ID, $meta_key ) ? '' : ' no_order';
$list[] = '<li class="product-list' . esc_html( $no_order ) . '">' . esc_html( self::crate_non_registerd_mark( $no_order ) ) . ' echo '<li class="product-list' . esc_attr( $no_order ) . '">'
<span class="sort-num-label">' . esc_html( $order ) . '</span>' . esc_html( $post_data->post_title ) . ' . esc_attr( self::crate_non_registerd_mark( $no_order ) )
<input type="hidden" class="list_order" name="_apop_post_' . esc_html( $key ) . '[post_sort][' . esc_html( $post_data->ID ) . ']" value="' . esc_html( $order ) . '"> . '<span class="sort-num-label">' . esc_html( $order ) . '</span>' . esc_html( $post_data->post_title )
</li>'; . '<input type="hidden" class="list_order"
name="_apop_post_' . esc_attr( $key ) . '[post_sort][' . esc_attr( $post_data->ID ) . ']"
value="' . esc_attr( $order ) . '">
</li>';
} }
return implode( PHP_EOL, $list );
} }
private static function crate_non_registerd_mark( $no_order ): string { private static function crate_non_registerd_mark( $no_order ): string {
@@ -270,7 +269,7 @@ value="' . esc_html( $sort_num ) . '">
); );
} }
public static function create_search_normal_list( $type, $id = null ): array { public static function create_search_normal_list( $type, $id = null ) {
$name_keys = self::create_name_keys( $id, $type ); $name_keys = self::create_name_keys( $id, $type );
$name_key = $name_keys['name_key']; $name_key = $name_keys['name_key'];
$get_option_key = $name_keys['get_option_key']; $get_option_key = $name_keys['get_option_key'];
@@ -298,67 +297,64 @@ value="' . esc_html( $sort_num ) . '">
$cnv_order_params = self::set_order_list_param( $order_param, $target_key ); $cnv_order_params = self::set_order_list_param( $order_param, $target_key );
$use = $cnv_order_params['use']; $use = $cnv_order_params['use'];
$sort = $cnv_order_params['sort']; $sort = $cnv_order_params['sort'];
$alert = $cnv_order_params['alert'];
$no_order_class = $cnv_order_params['no_order_class']; $no_order_class = $cnv_order_params['no_order_class'];
$field_metakey_input = ''; $field_metakey_input = '';
$name_use_key = '_' . $name_key . '[' . $target_key . '][use]'; $name_use_key = '_' . $name_key . '[' . $target_key . '][use]';
$name_sort_key = '_' . $name_key . '[' . $target_key . '][sort]'; $name_sort_key = '_' . $name_key . '[' . $target_key . '][sort]';
if ( strpos( $target_key, 'custom_field' ) !== false ) { 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'];
$field_metakey_input = self::create_custom_field_sort_type( $name_key, $target_key, $meta_key, $value_type );
$target_key_check_class = 'custom_field_check'; $target_key_check_class = 'custom_field_check';
} else { } else {
$target_key_check_class = 'sort_' . $target_key . '_check'; $target_key_check_class = 'sort_' . $target_key . '_check';
} }
$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> echo '<li class="product-list' . esc_attr( $no_order_class ) . '">
<div class="product-list-type-label"><b>' . esc_attr( $target_values[ $target_key ] ) . '</b></div>
<div class="product-list-sort-type"> <div class="product-list-sort-type">
<label> <label>
<input type="hidden" name="' . esc_html( $name_use_key ) . '" <input type="hidden" name="' . esc_attr( $name_use_key ) . '"
value="0"' . esc_html( self::set_search_normal_checked( $use, 0 ) ) . '> 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">有効</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 ) ) . '> type="checkbox" name="' . esc_attr( $name_use_key ) . '" value="1"' . esc_attr( self::set_search_normal_checked( $use, 1 ) ) . '>
</label> </label>
<label> <label>
<input class="order_param" type="radio" <input class="order_param" type="radio"
name="' . esc_html( $name_sort_key ) . '" name="' . esc_attr( $name_sort_key ) . '"
value="1"' . esc_html( self::set_search_normal_checked( $sort, 1 ) ) . '>昇順</label> value="1"' . esc_attr( self::set_search_normal_checked( $sort, 1 ) ) . '>昇順</label>
<label> <label>
<input class="order_param" type="radio" <input class="order_param" type="radio"
name="' . esc_html( $name_sort_key ) . '" name="' . esc_attr( $name_sort_key ) . '"
value="2"' . esc_html( self::set_search_normal_checked( $sort, 2 ) ) . '>降順</label> value="2"' . esc_attr( self::set_search_normal_checked( $sort, 2 ) ) . '>降順</label>';
' . $field_metakey_input . '
</div> if ( strpos( $target_key, 'custom_field' ) !== false ) {
self::create_custom_field_sort_type( $name_key, $target_key, $cnv_order_params );
}
echo '</div>
</li>'; </li>';
} }
return array(
implode( PHP_EOL, $list ),
$alert,
);
} }
private static function create_custom_field_sort_type( $name_key, $target_key, $meta_key, $value_type ): string { private static function create_custom_field_sort_type( $name_key, $target_key, $cnv_order_params ) {
$meta_key = $cnv_order_params[ $target_key ]['meta_key'];
$value_type = $cnv_order_params[ $target_key ]['value_type'];
$name_meta_key = '_' . $name_key . '[' . $target_key . '][field][meta_key]'; $name_meta_key = '_' . $name_key . '[' . $target_key . '][field][meta_key]';
$name_value_type = '_' . $name_key . '[' . $target_key . '][field][value_type]'; $name_value_type = '_' . $name_key . '[' . $target_key . '][field][value_type]';
echo '<div class="sort_custom_field">
return '<div class="sort_custom_field"> <div class="sort_custom_field_inner"><div class="sort_custom_field_inner_label">カスタムフィールドキー:</div>
<div class="sort_custom_field_inner"><div class="sort_custom_field_inner_label">カスタムフィールドキー:</div> <input type="text" class="custom_field_key" name="' . esc_attr( $name_meta_key ) . '" value="' . esc_attr( $meta_key ) . '">
<input type="text" class="custom_field_key" name="' . esc_html( $name_meta_key ) . '" value="' . esc_html( $meta_key ) . '"> </div>
</div> <div class="sort_custom_field_inner">
<div class="sort_custom_field_inner"> <div class="sort_custom_field_inner_label">値タイプ:</div>
<div class="sort_custom_field_inner_label">値タイプ:</div> <label><input type="radio"
<label><input type="radio" class="custom_field_meta_value"
class="custom_field_meta_value" name="' . esc_attr( $name_value_type ) . '"
name="' . esc_html( $name_value_type ) . '" value="meta_value"' . esc_attr( self::set_search_normal_checked( $value_type, 'meta_value' ) ) . '>テキスト</label>
value="meta_value"' . esc_html( self::set_search_normal_checked( $value_type, 'meta_value' ) ) . '>テキスト</label> <label><input type="radio"
<label><input type="radio" class="custom_field_meta_value"
class="custom_field_meta_value" name="' . esc_attr( $name_value_type ) . '"
name="' . esc_html( $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_html( self::set_search_normal_checked( $value_type, 'meta_value_num' ) ) . '>数値</label> </div>
</div> </div>';
</div>';
} }
private static function set_order_list_param( $order_param, $target_key ): array { private static function set_order_list_param( $order_param, $target_key ): array {
@@ -366,9 +362,9 @@ value="meta_value_num"' . esc_html( self::set_search_normal_checked( $value_type
$param = array( $param = array(
'use' => 0, 'use' => 0,
'sort' => 2, 'sort' => 2,
'alert' => '並べ替えを登録するには「変更を保存」をクリックしてください。',
'no_order_class' => ' no_order', 'no_order_class' => ' no_order',
); );
if ( strpos( $target_key, 'custom_field' ) !== false ) { if ( strpos( $target_key, 'custom_field' ) !== false ) {
$param[ $target_key ] = array( $param[ $target_key ] = array(
'meta_key' => '', 'meta_key' => '',
@@ -380,7 +376,6 @@ value="meta_value_num"' . esc_html( self::set_search_normal_checked( $value_type
$param = array( $param = array(
'use' => $order_param[ $target_key ]['use'] ?? 0, 'use' => $order_param[ $target_key ]['use'] ?? 0,
'sort' => $order_param[ $target_key ]['sort'] ?? 2, 'sort' => $order_param[ $target_key ]['sort'] ?? 2,
'alert' => ! $order_param[ $target_key ]['use'] ? '並べ替えを登録するには「変更を保存」をクリックしてください。' : '',
'no_order_class' => ! $order_param[ $target_key ]['use'] ? ' no_order' : '', 'no_order_class' => ! $order_param[ $target_key ]['use'] ? ' no_order' : '',
); );
if ( strpos( $target_key, 'custom_field' ) !== false ) { if ( strpos( $target_key, 'custom_field' ) !== false ) {
@@ -448,11 +443,11 @@ value="meta_value_num"' . esc_html( self::set_search_normal_checked( $value_type
} }
} }
public static function is_disp_per_page( &$disp, $disp_per_page ) { // public static function is_disp_per_page( &$disp, $disp_per_page ) {
if ( $disp_per_page ) { // if ( $disp_per_page ) {
$disp = true; // $disp = true;
} // }
} // }
} }
} }
+7 -11
View File
@@ -16,7 +16,7 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
<form action="" method="post"> <form action="" method="post">
<?php wp_nonce_field( 'sh_options' ); ?> <?php wp_nonce_field( 'sh_options' ); ?>
<input id="apop_submit_type" type="hidden" name="apop_submit_type" <input id="apop_submit_type" type="hidden" name="apop_submit_type"
value="<?php echo esc_html( $submit_type ); ?>"> value="<?php echo esc_attr( $submit_type ); ?>">
<div class="post-order-box"> <div class="post-order-box">
<div class="list-orders-outer"> <div class="list-orders-outer">
<div class="list-orders-inner"> <div class="list-orders-inner">
@@ -27,13 +27,12 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
?> ?>
<?php include APOP_PLUGIN_PATH . 'template/order_parts_menu.php'; ?> <?php include APOP_PLUGIN_PATH . 'template/order_parts_menu.php'; ?>
<hr> <hr>
<p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<div class="sort_box"> <div class="sort_box">
<?php list( $list, $alert) = APOP_UI::create_search_normal_list( 'normal' ); ?>
<p><?php echo esc_html( $alert ); ?></p>
<div class="enable_box"> <div class="enable_box">
<h4>有効</h4> <h4>有効</h4>
<ul class="post-order-list search_normal_sort"> <ul class="post-order-list search_normal_sort">
<?php echo $list; ?> <?php APOP_UI::create_search_normal_list( 'normal' ); ?>
</ul> </ul>
</div> </div>
<div class="disable_box"> <div class="disable_box">
@@ -42,9 +41,8 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
</div> </div>
</div> </div>
<div class="sort_box"> <div class="sort_box">
<div class="no_registered_exp">&#9632;は未登録項目です。ドラッグして並び順を変更後に「変更を保存」をクリックしてください。</div>
<ul class="post-order-list drag_sort"> <ul class="post-order-list drag_sort">
<?php echo APOP_UI::get_all_search_normal_posts( 'normal' ); ?> <?php APOP_UI::get_all_search_normal_posts( 'normal' ); ?>
</ul> </ul>
</div> </div>
</div> </div>
@@ -60,13 +58,12 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
?> ?>
<?php include APOP_PLUGIN_PATH . 'template/order_parts_menu.php'; ?> <?php include APOP_PLUGIN_PATH . 'template/order_parts_menu.php'; ?>
<hr> <hr>
<p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<div class="sort_box"> <div class="sort_box">
<?php list( $list, $alert) = APOP_UI::create_search_normal_list( 'search' ); ?>
<p><?php echo esc_html( $alert ); ?></p>
<div class="enable_box"> <div class="enable_box">
<h4>有効</h4> <h4>有効</h4>
<ul class="post-order-list search_normal_sort"> <ul class="post-order-list search_normal_sort">
<?php echo $list; ?> <?php APOP_UI::create_search_normal_list( 'search' ); ?>
</ul> </ul>
</div> </div>
<div class="disable_box"> <div class="disable_box">
@@ -75,9 +72,8 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );
</div> </div>
</div> </div>
<div class="sort_box"> <div class="sort_box">
<div class="no_registered_exp">&#9632;は未登録項目です。ドラッグして並び順を変更後に「変更を保存」をクリックしてください。</div>
<ul class="post-order-list drag_sort"> <ul class="post-order-list drag_sort">
<?php echo APOP_UI::get_all_search_normal_posts( 'search' ); ?> <?php APOP_UI::get_all_search_normal_posts( 'search' ); ?>
</ul> </ul>
</div> </div>
</div> </div>
+3 -3
View File
@@ -1,11 +1,11 @@
<?php if ( isset( $order_target, $order_target_type ) ): ?> <?php if ( isset( $order_target, $order_target_type ) ): ?>
<ul class="sort_menu_list" <ul class="sort_menu_list"
data-order_target="<?php echo esc_html($order_target); ?>"> data-order_target="<?php echo esc_attr( $order_target ); ?>">
<li><label> <li><label>
<input class="sort_menu" type="radio" name="<?php echo esc_html($order_target_type); ?>" <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 ); ?>>標準+カスタムフィールドソート</label></li>
<li><label> <li><label>
<input class="sort_menu" type="radio" name="<?php echo esc_html($order_target_type); ?>" <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 ); ?>>ドラッグソート</label></li>
</ul> </ul>
<?php endif; <?php endif;
+8 -7
View File
@@ -2,7 +2,6 @@
<?php foreach ( $tax_lists as $tax_key => $tax_list ) : ?> <?php foreach ( $tax_lists as $tax_key => $tax_list ) : ?>
<div class="list-orders-outer"> <div class="list-orders-outer">
<?php if ( count( $tax_list ) > 0 ): ?> <?php if ( count( $tax_list ) > 0 ): ?>
<div class="no_registered_exp">&#9632;は未登録項目です。ドラッグして並び順を変更後に「変更を保存」をクリックしてください。</div>
<?php foreach ( $tax_list as $tax_data ): ?> <?php foreach ( $tax_list as $tax_data ): ?>
<div class="list-orders-inner"> <div class="list-orders-inner">
<h3><?php echo esc_html( $tax_data->name ); ?></h3> <h3><?php echo esc_html( $tax_data->name ); ?></h3>
@@ -15,33 +14,35 @@
} }
?> ?>
<ul class="sort_menu_list" <ul class="sort_menu_list"
data-order_target="<?php echo esc_html( $order_target ); ?>"> data-order_target="<?php echo esc_attr( $order_target ); ?>">
<li> <li>
<label> <label>
<input class="sort_menu" type="radio" <input class="sort_menu" type="radio"
name="_apop_tax_sort_type[<?php echo esc_html( $tax_data->term_id ); ?>]" 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 ); ?>>ドラッグソート</label>
</li> </li>
<li> <li>
<label> <label>
<input class="sort_menu" type="radio" <input class="sort_menu" type="radio"
name="_apop_tax_sort_type[<?php echo esc_html( $tax_data->term_id ); ?>]" 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 ); ?>>標準+カスタムフィールドソート</label>
</li> </li>
</ul> </ul>
<div class="sort_box"> <div class="sort_box">
<hr>
<p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<ul class="post-order-list drag_sort"> <ul class="post-order-list drag_sort">
<?php echo APOP_UI::create_order_list( $tax_data, $tax_key ); ?> <?php echo APOP_UI::create_order_list( $tax_data, $tax_key ); ?>
</ul> </ul>
</div> </div>
<div class="sort_box"> <div class="sort_box">
<?php list( $list, $alert ) = APOP_UI::create_search_normal_list( 'tax', $tax_data->term_id ); ?> <hr>
<p><?php echo esc_html( $alert ); ?></p> <p>並べ替えを登録するには「変更を保存」をクリックしてください</p>
<div class="enable_box"> <div class="enable_box">
<h4>有効</h4> <h4>有効</h4>
<ul class="post-order-list search_normal_sort"> <ul class="post-order-list search_normal_sort">
<?php echo $list; ?> <?php APOP_UI::create_search_normal_list( 'tax', $tax_data->term_id ); ?>
</ul> </ul>
</div> </div>
<div class="disable_box"> <div class="disable_box">
+6 -9
View File
@@ -1,10 +1,6 @@
<div class="post-setting-box"> <div class="post-setting-box">
<form action="" method="post"> <form action="" method="post">
<?php <?php wp_nonce_field( 'sh_options' ); ?>
wp_nonce_field( 'sh_options' );
$opt_per_page = get_option( '_apop_per_page' );
$default_per_page = get_option( 'posts_per_page' );
?>
<h2>設定</h2> <h2>設定</h2>
<table class="form-table apop-form_table"> <table class="form-table apop-form_table">
<tr> <tr>
@@ -12,12 +8,12 @@
<td> <td>
<dl class="apop_setting_list"> <dl class="apop_setting_list">
<dt>1ページ表示件数</dt> <dt>1ページ表示件数</dt>
<dd><?php $per_page_data = APOP_UI::create_cat_per_page( $opt_per_page, 'search' ); ?> <dd><?php $per_page_data = APOP_UI::create_cat_per_page( get_option( '_apop_per_page' ), 'search' ); ?>
<ul> <ul>
<li> <li>
<label> <label>
<input class="per_page_search" type="radio" name="_apop_per_page[search]" <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($default_per_page); ?> value="default"<?php checked( $per_page_data['_per_page'], 'default' ); ?>>表示設定に従う(<?php echo esc_html( get_option( 'posts_per_page' ) ); ?>
件)</label> 件)</label>
</li> </li>
<li><label> <li><label>
@@ -27,10 +23,11 @@
<li> <li>
<label><input class="per_page_search" type="radio" <label><input class="per_page_search" type="radio"
name="_apop_per_page[search]" name="_apop_per_page[search]"
value="<?php echo esc_html($per_page_data['_checked']); ?>">表示数設定 value="" <?php echo esc_attr( $per_page_data['_checked'] ); ?>>表示数設定
<input class="per_page_search_input" type="text" <input class="per_page_search_input" type="text"
name="_apop_per_page[search]" name="_apop_per_page[search]"
value="<?php echo esc_html($per_page_data['_per_page_num']); ?>" required> value="<?php echo esc_attr( $per_page_data['_per_page_num'] ); ?>"
required>
</label> </label>
</li> </li>
</ul> </ul>
+13 -17
View File
@@ -1,8 +1,4 @@
<?php if ( isset( $tax_data, $order_name, $order_tax ) ): ?> <?php if ( isset( $tax_data, $order_name, $order_tax ) ): ?>
<?php
$default_per_page = get_option( 'posts_per_page' );
$opt_per_page = get_option( '_apop_per_page' );
?>
<dl class="apop_setting_list"> <dl class="apop_setting_list">
<dt>対象</dt> <dt>対象</dt>
<dd> <dd>
@@ -11,48 +7,48 @@
<?php <?php
$opt_cat = get_option( $order_name ); $opt_cat = get_option( $order_name );
$check_slug = $opt_cat['target_cat'][ $tax_datum->term_id ] ?? ''; $check_slug = $opt_cat['target_cat'][ $tax_datum->term_id ] ?? '';
APOP_UI::is_disp_per_page( $disp, $check_slug );
?> ?>
<li> <li>
<div class="select_cat"> <div class="select_cat">
<label> <label>
<input type="hidden" <input type="hidden"
name="<?php echo esc_html($order_name); ?>[target_cat][<?php echo esc_html($tax_datum->term_id); ?>]" name="<?php echo esc_attr( $order_name ); ?>[target_cat][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value="0"> value="0">
<input class="select_cat_checkbox" type="checkbox" <input class="select_cat_checkbox" type="checkbox"
name="<?php echo esc_html($order_name); ?>[target_cat][<?php echo esc_html($tax_datum->term_id); ?>]" name="<?php echo esc_attr( $order_name ); ?>[target_cat][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
<?php checked( $check_slug, 1 ); ?> <?php checked( $check_slug, 1 ); ?>
value="1"> value="1">
<?php echo esc_html($tax_datum->name); ?> <?php echo esc_html( $tax_datum->name ); ?>
</label> </label>
</div> </div>
<?php $per_page_data = APOP_UI::create_tax_per_page( $opt_per_page, $order_tax, $tax_datum->term_id ); ?> <?php $per_page_data = APOP_UI::create_tax_per_page( get_option( '_apop_per_page' ), $order_tax, $tax_datum->term_id ); ?>
<div class="select_per_page"> <div class="select_per_page">
<ul> <ul>
<li> <li>
<label> <label>
<input class="per_page_cat" type="radio" <input class="per_page_cat" type="radio"
name="_apop_per_page[<?php echo esc_html($order_tax); ?>][<?php echo esc_html($tax_datum->term_id); ?>]" 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($default_per_page); ?> value="default"<?php checked( $per_page_data['_per_page'], 'default' ); ?>>表示設定に従う(<?php echo esc_html( get_option( 'posts_per_page' ) ); ?>
件)</label> 件)</label>
</li> </li>
<li><label> <li><label>
<input class="per_page_cat" type="radio" <input class="per_page_cat" type="radio"
name="_apop_per_page[<?php echo esc_html($order_tax); ?>][<?php echo esc_html($tax_datum->term_id); ?>]" 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' ); ?>>全体設定に従う</label>
</li> </li>
<li><label> <li><label>
<input class="per_page_cat" type="radio" <input class="per_page_cat" type="radio"
name="_apop_per_page[<?php echo esc_html($order_tax); ?>][<?php echo esc_html($tax_datum->term_id); ?>]" 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' ); ?>>全件</label>
</li> </li>
<li class="set_number_list"> <li class="set_number_list">
<label><input class="per_page_cat set_number" type="radio" <label><input class="per_page_cat set_number" type="radio"
name="_apop_per_page[<?php echo esc_html($order_tax); ?>][<?php echo esc_html($tax_datum->term_id); ?>]" name="_apop_per_page[<?php echo esc_attr( $order_tax ); ?>][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value=""<?php echo esc_html($per_page_data['_checked']); ?>>表示数設定 value=""<?php echo esc_attr( $per_page_data['_checked'] ); ?>>表示数設定
<input class="per_page_cat_input" type="text" <input class="per_page_cat_input" type="text"
name="_apop_per_page[<?php echo esc_html($order_tax); ?>][<?php echo esc_html($tax_datum->term_id); ?>]" name="_apop_per_page[<?php echo esc_attr( $order_tax ); ?>][<?php echo esc_attr( $tax_datum->term_id ); ?>]"
value="<?php echo esc_html($per_page_data['_per_page_num']); ?>" required> value="<?php echo esc_attr( $per_page_data['_per_page_num'] ); ?>"
required>
</label> </label>
</li> </li>
</ul> </ul>
+2 -2
View File
@@ -9,8 +9,8 @@
<?php if ( ! empty( $item ) ): ?> <?php if ( ! empty( $item ) ): ?>
<li><label><?php echo esc_html( $item ); ?></label> <li><label><?php echo esc_html( $item ); ?></label>
<input type="text" <input type="text"
name="<?php echo esc_html( APOP_CUSTOM_FIELD_PREFIX . $item ); ?>" name="<?php echo esc_attr( APOP_CUSTOM_FIELD_PREFIX . $item ); ?>"
value="<?php echo esc_html( $this->get_custom_field_data( $item ) ); ?>"/> value="<?php echo esc_attr( $this->get_custom_field_data( $item ) ); ?>"/>
</li> </li>
<?php endif; ?> <?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>