diff --git a/class/class.apop.apop_post.php b/class/class.apop.apop_post.php index efb098e..f17e540 100644 --- a/class/class.apop.apop_post.php +++ b/class/class.apop.apop_post.php @@ -38,9 +38,13 @@ if ( ! class_exists( 'APOP_POST' ) ) { public function insert_meta_fields() { //通常ソート - $this->create_order_field_data( get_option( '_apop_normal_order_param' ), 'normal' ); + 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_search_order_param' ), 'search' ); + if ( get_option( '_apop_tax_sort_type' ) == '1' ) { + $this->create_order_field_data( get_option( '_apop_search_order_param' ), 'search' ); + } //カテゴリー、タグ、カスタム分類 $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 ) { $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])){ + continue; + } + if($sort_types[$term_id] == '1'){ + break; + } foreach ( $this->order_param_keys as $order_param_key ) { if ( isset( $param[ $term_id ][ $order_param_key ]['field']['meta_key'] ) && ! empty( $param[ $term_id ][ $order_param_key ]['field']['meta_key'] ) ) { diff --git a/class/class.apop.apop_ui.php b/class/class.apop.apop_ui.php index eb6120b..28d0aab 100644 --- a/class/class.apop.apop_ui.php +++ b/class/class.apop.apop_ui.php @@ -15,9 +15,7 @@ if ( ! class_exists( 'APOP_UI' ) ) { return $type_data; } - public static function get_all_search_normal_posts( - $key - ): string { + public static function get_all_search_normal_posts( $key ) { $meta_key = '_apop_post_' . $key; $args = self::create_search_normal_args( $meta_key ); $posts_data = get_posts( $args ); @@ -25,13 +23,14 @@ 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[] = '