| @@ 1193-1216 (lines=24) @@ | ||
| 1190 | * @access private |
|
| 1191 | * @return void |
|
| 1192 | */ |
|
| 1193 | private function _set_category_object() { |
|
| 1194 | if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
| 1195 | return; //already have the category object so get out. |
|
| 1196 | ||
| 1197 | //set default category object |
|
| 1198 | $this->_set_empty_category_object(); |
|
| 1199 | ||
| 1200 | //only set if we've got an id |
|
| 1201 | if ( !isset($this->_req_data['VEN_CAT_ID'] ) ) { |
|
| 1202 | return; |
|
| 1203 | } |
|
| 1204 | ||
| 1205 | $category_id = absint($this->_req_data['VEN_CAT_ID']); |
|
| 1206 | $term = get_term( $category_id, 'espresso_venue_categories' ); |
|
| 1207 | ||
| 1208 | ||
| 1209 | if ( !empty( $term ) ) { |
|
| 1210 | $this->_category->category_name = $term->name; |
|
| 1211 | $this->_category->category_identifier = $term->slug; |
|
| 1212 | $this->_category->category_desc = $term->description; |
|
| 1213 | $this->_category->id = $term->term_id; |
|
| 1214 | $this->_category->parent = $term->parent; |
|
| 1215 | } |
|
| 1216 | } |
|
| 1217 | ||
| 1218 | ||
| 1219 | ||
| @@ 2126-2149 (lines=24) @@ | ||
| 2123 | * @access private |
|
| 2124 | * @return void |
|
| 2125 | */ |
|
| 2126 | private function _set_category_object() { |
|
| 2127 | if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
| 2128 | return; //already have the category object so get out. |
|
| 2129 | ||
| 2130 | //set default category object |
|
| 2131 | $this->_set_empty_category_object(); |
|
| 2132 | ||
| 2133 | //only set if we've got an id |
|
| 2134 | if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) { |
|
| 2135 | return; |
|
| 2136 | } |
|
| 2137 | ||
| 2138 | $category_id = absint($this->_req_data['EVT_CAT_ID']); |
|
| 2139 | ||
| 2140 | $term = get_term( $category_id, 'espresso_event_categories' ); |
|
| 2141 | ||
| 2142 | if ( !empty( $term ) ) { |
|
| 2143 | $this->_category->category_name = $term->name; |
|
| 2144 | $this->_category->category_identifier = $term->slug; |
|
| 2145 | $this->_category->category_desc = $term->description; |
|
| 2146 | $this->_category->id = $term->term_id; |
|
| 2147 | $this->_category->parent = $term->parent; |
|
| 2148 | } |
|
| 2149 | } |
|
| 2150 | ||
| 2151 | ||
| 2152 | ||