WP PLUGIN 

・カスタムフィールドの必須チェック漏れの修正
・既存カスタムフィールド選択も可能なよう修正
・ソートのリストに背景色を設定
・並べ替え設定ページの更新ボタン位置を修正
・カテゴリー、タグ、カスタム分類のソート対象選択のラジオボタン並び順を標準、検索と同一になるよう修正
This commit is contained in:
2021-06-25 20:58:52 +09:00
parent c7996062fa
commit f6d64404a7
12 changed files with 202 additions and 57 deletions
+10 -7
View File
@@ -11,6 +11,7 @@ if ( ! class_exists( 'APOP_POST' ) ) {
const TEMPLATE_DIR = __DIR__ . '/../template/';
private $order_field = array();
private $custom_field_type = array();
private $name_keys = array();
private $order_param_keys = array(
'custom_field',
@@ -71,20 +72,21 @@ if ( ! class_exists( 'APOP_POST' ) ) {
if ( $update ) {
$this->name_keys[] = $param[ $order_param_key ]['field']['meta_key'];
} else {
$this->order_field[ $key ][] = $param[ $order_param_key ]['field']['meta_key'];
$this->custom_field_type[ $key ][] = $param[ $order_param_key ]['field']['custom_field_type'];
$this->order_field[ $key ][] = $param[ $order_param_key ]['field']['meta_key'];
}
}
}
}
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 ) {
if(!isset($sort_types[$term_id])){
if ( ! isset( $sort_types[ $term_id ] ) ) {
continue;
}
if($sort_types[$term_id] == '1'){
if ( $sort_types[ $term_id ] == '1' ) {
break;
}
foreach ( $this->order_param_keys as $order_param_key ) {
@@ -93,7 +95,8 @@ if ( ! class_exists( 'APOP_POST' ) ) {
if ( $update ) {
$this->name_keys[] = $param[ $term_id ][ $order_param_key ]['field']['meta_key'];
} else {
$this->order_field['tax'][] = $param[ $term_id ][ $order_param_key ]['field']['meta_key'];
$this->custom_field_type['tax'][] = $param[ $term_id ][ $order_param_key ]['field']['custom_field_type'];
$this->order_field['tax'][] = $param[ $term_id ][ $order_param_key ]['field']['meta_key'];
}
}
}
@@ -118,10 +121,10 @@ if ( ! class_exists( 'APOP_POST' ) ) {
return $term_ids;
}
private function get_custom_field_data( $custom_filed_name ) {
private function get_custom_field_data( $custom_filed_name, $prefix ) {
global $post;
return get_post_meta( $post->ID, APOP_CUSTOM_FIELD_PREFIX . $custom_filed_name, true );
return get_post_meta( $post->ID, $prefix . $custom_filed_name, true );
}
// カスタムフィールドの値を保存