소스 검색

:recycle: checking for materials in api query

tags/0.9.0
J 4 년 전
부모
커밋
d9b8168ed7
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5
    1
      plugins/cia-endpoints/includes/class.make-sortby.php

+ 5
- 1
plugins/cia-endpoints/includes/class.make-sortby.php 파일 보기

@@ -34,8 +34,12 @@ class Make_Sort_By extends WP_REST_Controller {
34 34
         }
35 35
         
36 36
         if($this->post_type == 'artist') {
37
+            //  Default to all materials
37 38
             $tax_id_array = [3, 4, 5, 6, 7, 8];
38
-            $tax_id_array = explode( ',', $params['materials'] );
39
+
40
+            if ($params['materials']) {
41
+                $tax_id_array = explode( ',', $params['materials'] );
42
+            }
39 43
             // 3 clay
40 44
             // 4 fiber
41 45
             // 5 glass

Loading…
취소
저장