Changeset 3003610
- Timestamp:
- 11/30/2023 08:04:40 AM (2 years ago)
- File:
-
- 1 edited
-
belingogeo/trunk/includes/sitemaps.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
belingogeo/trunk/includes/sitemaps.php
r2995585 r3003610 24 24 } 25 25 } 26 27 belingoGeo_get_xml($urls); 28 exit; 26 27 if(is_array($urls) && count($urls) > 0) { 28 belingoGeo_get_xml($urls); 29 exit; 30 }else{ 31 global $wp_query; 32 $wp_query->set_404(); 33 status_header( 404 ); 34 nocache_headers(); 35 } 29 36 30 37 } … … 151 158 } 152 159 $taxonomies = get_object_taxonomies( array( 'post_type' => $post_type ), 'objects' ); 160 $exclude_taxonomies = get_option('belingo_geo_exclude_taxonomies'); 153 161 foreach($taxonomies as $taxonomy) { 154 if($taxonomy->public == 1 && $taxonomy->show_ui == 1 ) {162 if($taxonomy->public == 1 && $taxonomy->show_ui == 1 && !array_key_exists($taxonomy->name, $exclude_taxonomies)) { 155 163 $url = [ 156 164 "loc" => get_site_url() . '/'.$city->get_slug().'_sitemap_tax_'.$taxonomy->name.'.xml', … … 278 286 $urls = []; 279 287 280 $terms = get_terms(array( 281 'taxonomy' => $taxonomy 282 )); 283 foreach ($terms as $term) { 284 $loc = get_term_link($term->slug, $taxonomy); 285 $current_city = belingoGeo_get_current_city(); 286 if($current_city) { 287 $loc = belingogeo_remove_city_url($loc, $current_city->get_slug()); 288 } 289 $loc = belingoGeo_append_city_url($loc, $city); 290 $urls[] = [ 291 "loc" => $loc, 292 "lastmod" => date('c',time()) 293 ]; 288 $exclude_taxonomies = get_option('belingo_geo_exclude_taxonomies'); 289 290 if(!array_key_exists($taxonomy, $exclude_taxonomies)) { 291 292 $terms = get_terms(array( 293 'taxonomy' => $taxonomy 294 )); 295 foreach ($terms as $term) { 296 $loc = get_term_link($term->slug, $taxonomy); 297 $current_city = belingoGeo_get_current_city(); 298 if($current_city) { 299 $loc = belingogeo_remove_city_url($loc, $current_city->get_slug()); 300 } 301 $loc = belingoGeo_append_city_url($loc, $city); 302 $urls[] = [ 303 "loc" => $loc, 304 "lastmod" => date('c',time()) 305 ]; 306 } 307 294 308 } 295 309
Note: See TracChangeset
for help on using the changeset viewer.