| @@ 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 | ||
| @@ 2084-2107 (lines=24) @@ | ||
| 2081 | * @access private |
|
| 2082 | * @return void |
|
| 2083 | */ |
|
| 2084 | private function _set_category_object() { |
|
| 2085 | if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
| 2086 | return; //already have the category object so get out. |
|
| 2087 | ||
| 2088 | //set default category object |
|
| 2089 | $this->_set_empty_category_object(); |
|
| 2090 | ||
| 2091 | //only set if we've got an id |
|
| 2092 | if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) { |
|
| 2093 | return; |
|
| 2094 | } |
|
| 2095 | ||
| 2096 | $category_id = absint($this->_req_data['EVT_CAT_ID']); |
|
| 2097 | ||
| 2098 | $term = get_term( $category_id, 'espresso_event_categories' ); |
|
| 2099 | ||
| 2100 | if ( !empty( $term ) ) { |
|
| 2101 | $this->_category->category_name = $term->name; |
|
| 2102 | $this->_category->category_identifier = $term->slug; |
|
| 2103 | $this->_category->category_desc = $term->description; |
|
| 2104 | $this->_category->id = $term->term_id; |
|
| 2105 | $this->_category->parent = $term->parent; |
|
| 2106 | } |
|
| 2107 | } |
|
| 2108 | ||
| 2109 | ||
| 2110 | ||