| @@ -96,14 +96,26 @@ | ||
| 96 | 96 | $this->sortColumn = (isset($this->data_cookie['sortColumn'])) ? $this->data_cookie['sortColumn'] :'ID'; |
| 97 | 97 | $this->searchSql = (isset($this->data_cookie['searchSql'])) ? $this->data_cookie['searchSql'] :''; |
| 98 | 98 | $this->searchSwitchStatus = (isset($this->data_cookie['searchSwitchStatus'])) ? $this->data_cookie['searchSwitchStatus'] :'OFF'; |
| 99 | 99 | if (isset($this->data_cookie['arr_search'])) { |
| 100 | - $this->arr_search = $this->data_cookie['arr_search']; | |
| 100 | + $this->arr_search = wp_parse_args( | |
| 101 | + $this->data_cookie['arr_search'], | |
| 102 | + array( | |
| 103 | + 'period' => '3', | |
| 104 | + 'column' => '', | |
| 105 | + 'word' => '', | |
| 106 | + ) | |
| 107 | + ); | |
| 101 | 108 | } else { |
| 102 | 109 | $this->arr_search = array('period'=>'3', 'column'=>'', 'word'=>''); |
| 103 | 110 | } |
| 104 | 111 | if (isset($this->data_cookie['sortSwitchs'])) { |
| 105 | 112 | $this->sortSwitchs = $this->data_cookie['sortSwitchs']; |
| 113 | + foreach ( $this->columns as $key => $value ) { | |
| 114 | + if ( ! isset( $this->sortSwitchs[ $value ] ) ) { | |
| 115 | + $this->sortSwitchs[ $value ] = 'DESC'; | |
| 116 | + } | |
| 117 | + } | |
| 106 | 118 | } else { |
| 107 | 119 | foreach($this->columns as $key => $value ){ |
| 108 | 120 | $this->sortSwitchs[$value] = 'DESC'; |
| 109 | 121 | } |