WP PLUGIN 変数定義チェック漏れ等の修正
・変数チェック漏れの修正 ・スタイル修正
This commit is contained in:
@@ -90,9 +90,8 @@ if ( ! trait_exists( 'APOP_ORDER_SETTING' ) ) {
|
||||
|
||||
private static function set_custom_filed_sort( &$orderby, $order_col, $orders, $sort_param ): array {
|
||||
if ( strpos( $order_col, 'custom_field' ) !== false ) {
|
||||
$meta_key = APOP_CUSTOM_FIELD_PREFIX . $orders['field']['meta_key'];
|
||||
$orderby_sort = $orders['sort'];
|
||||
$type = 'CHAR';
|
||||
$meta_key = APOP_CUSTOM_FIELD_PREFIX . $orders['field']['meta_key'];
|
||||
$type = 'CHAR';
|
||||
if ( $orders['field']['value_type'] == 'meta_value_num' ) {
|
||||
$type = 'NUMERIC';
|
||||
} elseif ( $orders['field']['value_type'] == 'meta_value' ) {
|
||||
@@ -100,7 +99,9 @@ if ( ! trait_exists( 'APOP_ORDER_SETTING' ) ) {
|
||||
} elseif ( $orders['field']['value_type'] == 'meta_date' ) {
|
||||
$type = 'DATE';
|
||||
}
|
||||
$orderby[ $meta_key ] = $sort_param[ $orderby_sort ];
|
||||
if ( isset( $orders['sort'] ) ) {
|
||||
$orderby[ $meta_key ] = $sort_param[ $orders['sort'] ];
|
||||
}
|
||||
|
||||
return array( $meta_key, $type );
|
||||
}
|
||||
@@ -188,7 +189,9 @@ if ( ! trait_exists( 'APOP_ORDER_SETTING' ) ) {
|
||||
list( $sort_meta_key, $type ) = self::set_custom_filed_sort( $orderby, $order_col, $orders, $sort_param );
|
||||
$meta_query[] = self::get_all_post_args( $sort_meta_key, $type );
|
||||
} else {
|
||||
$orderby[ $order_col ] = $sort_param[ $orders['sort'] ];
|
||||
if ( isset( $orders['sort'] ) ) {
|
||||
$orderby[ $order_col ] = $sort_param[ $orders['sort'] ];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user