| @@ 1191-1214 (lines=24) @@ | ||
| 1188 | * @access private |
|
| 1189 | * @return void |
|
| 1190 | */ |
|
| 1191 | private function _set_category_object() { |
|
| 1192 | if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
| 1193 | return; //already have the category object so get out. |
|
| 1194 | ||
| 1195 | //set default category object |
|
| 1196 | $this->_set_empty_category_object(); |
|
| 1197 | ||
| 1198 | //only set if we've got an id |
|
| 1199 | if ( !isset($this->_req_data['VEN_CAT_ID'] ) ) { |
|
| 1200 | return; |
|
| 1201 | } |
|
| 1202 | ||
| 1203 | $category_id = absint($this->_req_data['VEN_CAT_ID']); |
|
| 1204 | $term = get_term( $category_id, 'espresso_venue_categories' ); |
|
| 1205 | ||
| 1206 | ||
| 1207 | if ( !empty( $term ) ) { |
|
| 1208 | $this->_category->category_name = $term->name; |
|
| 1209 | $this->_category->category_identifier = $term->slug; |
|
| 1210 | $this->_category->category_desc = $term->description; |
|
| 1211 | $this->_category->id = $term->term_id; |
|
| 1212 | $this->_category->parent = $term->parent; |
|
| 1213 | } |
|
| 1214 | } |
|
| 1215 | ||
| 1216 | ||
| 1217 | ||
| @@ 2078-2101 (lines=24) @@ | ||
| 2075 | * @access private |
|
| 2076 | * @return void |
|
| 2077 | */ |
|
| 2078 | private function _set_category_object() { |
|
| 2079 | if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
| 2080 | return; //already have the category object so get out. |
|
| 2081 | ||
| 2082 | //set default category object |
|
| 2083 | $this->_set_empty_category_object(); |
|
| 2084 | ||
| 2085 | //only set if we've got an id |
|
| 2086 | if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) { |
|
| 2087 | return; |
|
| 2088 | } |
|
| 2089 | ||
| 2090 | $category_id = absint($this->_req_data['EVT_CAT_ID']); |
|
| 2091 | ||
| 2092 | $term = get_term( $category_id, 'espresso_event_categories' ); |
|
| 2093 | ||
| 2094 | if ( !empty( $term ) ) { |
|
| 2095 | $this->_category->category_name = $term->name; |
|
| 2096 | $this->_category->category_identifier = $term->slug; |
|
| 2097 | $this->_category->category_desc = $term->description; |
|
| 2098 | $this->_category->id = $term->term_id; |
|
| 2099 | $this->_category->parent = $term->parent; |
|
| 2100 | } |
|
| 2101 | } |
|
| 2102 | ||
| 2103 | ||
| 2104 | ||