@@ 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 |
@@ 2132-2155 (lines=24) @@ | ||
2129 | * @access private |
|
2130 | * @return void |
|
2131 | */ |
|
2132 | private function _set_category_object() { |
|
2133 | if ( isset( $this->_category->id ) && !empty( $this->_category->id ) ) |
|
2134 | return; //already have the category object so get out. |
|
2135 | ||
2136 | //set default category object |
|
2137 | $this->_set_empty_category_object(); |
|
2138 | ||
2139 | //only set if we've got an id |
|
2140 | if ( !isset($this->_req_data['EVT_CAT_ID'] ) ) { |
|
2141 | return; |
|
2142 | } |
|
2143 | ||
2144 | $category_id = absint($this->_req_data['EVT_CAT_ID']); |
|
2145 | ||
2146 | $term = get_term( $category_id, 'espresso_event_categories' ); |
|
2147 | ||
2148 | if ( !empty( $term ) ) { |
|
2149 | $this->_category->category_name = $term->name; |
|
2150 | $this->_category->category_identifier = $term->slug; |
|
2151 | $this->_category->category_desc = $term->description; |
|
2152 | $this->_category->id = $term->term_id; |
|
2153 | $this->_category->parent = $term->parent; |
|
2154 | } |
|
2155 | } |
|
2156 | ||
2157 | ||
2158 |