Changeset 2525101
- Timestamp:
- 05/03/2021 06:29:45 AM (5 years ago)
- Location:
- sitetree
- Files:
-
- 5 deleted
- 9 edited
- 49 copied
-
tags/6.0.2 (copied) (copied from sitetree/trunk)
-
tags/6.0.2/admin/admin-controller.class.php (copied) (copied from sitetree/trunk/admin/admin-controller.class.php)
-
tags/6.0.2/admin/dashboard-page-view.class.php (copied) (copied from sitetree/trunk/admin/dashboard-page-view.class.php)
-
tags/6.0.2/admin/field-view.class.php (copied) (copied from sitetree/trunk/admin/field-view.class.php)
-
tags/6.0.2/admin/leaves-page-view.class.php (copied) (copied from sitetree/trunk/admin/leaves-page-view.class.php)
-
tags/6.0.2/admin/meta-box-controller.class.php (copied) (copied from sitetree/trunk/admin/meta-box-controller.class.php)
-
tags/6.0.2/admin/page-controller-classes.php (copied) (copied from sitetree/trunk/admin/page-controller-classes.php) (1 diff)
-
tags/6.0.2/admin/page-view-delegate-protocols.php (copied) (copied from sitetree/trunk/admin/page-view-delegate-protocols.php)
-
tags/6.0.2/admin/page-view.class.php (copied) (copied from sitetree/trunk/admin/page-view.class.php)
-
tags/6.0.2/admin/ping-controller.class.php (copied) (copied from sitetree/trunk/admin/ping-controller.class.php)
-
tags/6.0.2/admin/ping-state.class.php (copied) (copied from sitetree/trunk/admin/ping-state.class.php)
-
tags/6.0.2/admin/sitetree-field-view.class.php (deleted)
-
tags/6.0.2/admin/sitetree-page-view.class.php (deleted)
-
tags/6.0.2/core (deleted)
-
tags/6.0.2/data-model/advanced-page-data.php (copied) (copied from sitetree/trunk/data-model/advanced-page-data.php)
-
tags/6.0.2/data-model/dashboard-page-data.php (copied) (copied from sitetree/trunk/data-model/dashboard-page-data.php) (2 diffs)
-
tags/6.0.2/data-model/data-controller.class.php (copied) (copied from sitetree/trunk/data-model/data-controller.class.php)
-
tags/6.0.2/data-model/data-model-classes.php (copied) (copied from sitetree/trunk/data-model/data-model-classes.php)
-
tags/6.0.2/data-model/global-objects-resources.php (copied) (copied from sitetree/trunk/data-model/global-objects-resources.php)
-
tags/6.0.2/data-model/leaves-page-data.php (copied) (copied from sitetree/trunk/data-model/leaves-page-data.php)
-
tags/6.0.2/data-model/site_tree-page-data.php (copied) (copied from sitetree/trunk/data-model/site_tree-page-data.php)
-
tags/6.0.2/data-model/sitemap-page-data.php (deleted)
-
tags/6.0.2/includes/builders (copied) (copied from sitetree/trunk/includes/builders)
-
tags/6.0.2/includes/builders/builder-core.class.php (copied) (copied from sitetree/trunk/includes/builders/builder-core.class.php)
-
tags/6.0.2/includes/builders/builders-interfaces.php (copied) (copied from sitetree/trunk/includes/builders/builders-interfaces.php)
-
tags/6.0.2/includes/builders/google-sitemap-builder.class.php (copied) (copied from sitetree/trunk/includes/builders/google-sitemap-builder.class.php)
-
tags/6.0.2/includes/builders/image-element.class.php (copied) (copied from sitetree/trunk/includes/builders/image-element.class.php)
-
tags/6.0.2/includes/builders/newsmap-builder.class.php (copied) (copied from sitetree/trunk/includes/builders/newsmap-builder.class.php)
-
tags/6.0.2/includes/builders/site-tree-builder.class.php (copied) (copied from sitetree/trunk/includes/builders/site-tree-builder.class.php)
-
tags/6.0.2/includes/builders/sitemap-builder.class.php (copied) (copied from sitetree/trunk/includes/builders/sitemap-builder.class.php)
-
tags/6.0.2/includes/builders/stylesheet-builder.class.php (copied) (copied from sitetree/trunk/includes/builders/stylesheet-builder.class.php) (3 diffs)
-
tags/6.0.2/includes/core-delegate.class.php (copied) (copied from sitetree/trunk/includes/core-delegate.class.php) (1 diff)
-
tags/6.0.2/includes/core.class.php (copied) (copied from sitetree/trunk/includes/core.class.php) (1 diff)
-
tags/6.0.2/includes/hyperlist-controller.class.php (copied) (copied from sitetree/trunk/includes/hyperlist-controller.class.php)
-
tags/6.0.2/includes/index.php (copied) (copied from sitetree/trunk/includes/index.php)
-
tags/6.0.2/includes/indexer.class.php (copied) (copied from sitetree/trunk/includes/indexer.class.php) (3 diffs)
-
tags/6.0.2/includes/paginator.class.php (copied) (copied from sitetree/trunk/includes/paginator.class.php)
-
tags/6.0.2/includes/robots-delegate.class.php (copied) (copied from sitetree/trunk/includes/robots-delegate.class.php)
-
tags/6.0.2/includes/template-tags.php (copied) (copied from sitetree/trunk/includes/template-tags.php)
-
tags/6.0.2/includes/upgrader.class.php (copied) (copied from sitetree/trunk/includes/upgrader.class.php) (3 diffs)
-
tags/6.0.2/library/base-plugin.class.php (copied) (copied from sitetree/trunk/library/base-plugin.class.php)
-
tags/6.0.2/library/db.class.php (copied) (copied from sitetree/trunk/library/db.class.php)
-
tags/6.0.2/library/functions.php (copied) (copied from sitetree/trunk/library/functions.php)
-
tags/6.0.2/library/index.php (copied) (copied from sitetree/trunk/library/index.php)
-
tags/6.0.2/library/plugin-upgrader.class.php (copied) (copied from sitetree/trunk/library/plugin-upgrader.class.php)
-
tags/6.0.2/library/plugin.class.php (deleted)
-
tags/6.0.2/readme.txt (copied) (copied from sitetree/trunk/readme.txt) (3 diffs)
-
tags/6.0.2/resources/fonts (copied) (copied from sitetree/trunk/resources/fonts)
-
tags/6.0.2/resources/sitetree-min.css (copied) (copied from sitetree/trunk/resources/sitetree-min.css)
-
tags/6.0.2/resources/sitetree-min.js (copied) (copied from sitetree/trunk/resources/sitetree-min.js)
-
tags/6.0.2/resources/sitetree.css (copied) (copied from sitetree/trunk/resources/sitetree.css)
-
tags/6.0.2/resources/sitetree.js (copied) (copied from sitetree/trunk/resources/sitetree.js)
-
tags/6.0.2/sitetree.php (copied) (copied from sitetree/trunk/sitetree.php) (2 diffs)
-
tags/6.0.2/uninstall.php (copied) (copied from sitetree/trunk/uninstall.php)
-
trunk/admin/page-controller-classes.php (modified) (1 diff)
-
trunk/data-model/dashboard-page-data.php (modified) (2 diffs)
-
trunk/includes/builders/stylesheet-builder.class.php (modified) (3 diffs)
-
trunk/includes/core-delegate.class.php (modified) (1 diff)
-
trunk/includes/core.class.php (modified) (1 diff)
-
trunk/includes/indexer.class.php (modified) (3 diffs)
-
trunk/includes/upgrader.class.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/sitetree.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sitetree/tags/6.0.2/admin/page-controller-classes.php
r2521279 r2525101 317 317 $sitemap_filename_has_changed = false; 318 318 319 if ( $form_id == 'sitemap' ) { 320 $old_sitemap_filename = $this->db->getOption( 'sitemap_filename' ); 321 } 322 else { 323 $content_types_id = $form_id . '_content_types'; 324 $content_flags = $config_options[$content_types_id]; 325 $at_least_one_content_type_is_included = false; 326 327 foreach ( $content_flags as $content_type_included ) { 328 if ( $content_type_included ) { 329 $at_least_one_content_type_is_included = true; 330 331 break; 332 } 333 } 334 335 if (! $at_least_one_content_type_is_included ) { 336 if ( $form_id === 'newsmap' ) { 337 $config_options[$content_types_id]['post'] = true; 338 } 339 else { 340 $config_options[$content_types_id]['page'] = true; 341 } 342 } 343 344 if ( $form_id == 'site_tree' ) { 319 switch ( $form_id ) { 320 case 'site_tree': 345 321 $old_site_tree_id = (int) $this->db->getOption( 'page_for_site_tree' ); 322 break; 323 324 case 'sitemap': 325 $old_sitemap_filename = $this->db->getOption( 'sitemap_filename' ); 326 break; 327 } 328 329 $content_types_id = $form_id . '_content_types'; 330 $content_flags = $config_options[$content_types_id]; 331 $at_least_one_content_type_is_included = false; 332 333 foreach ( $content_flags as $content_type_included ) { 334 if ( $content_type_included ) { 335 $at_least_one_content_type_is_included = true; 336 337 break; 338 } 339 } 340 341 if (! $at_least_one_content_type_is_included ) { 342 if ( $form_id === 'newsmap' ) { 343 $config_options[$content_types_id]['post'] = true; 344 } 345 else { 346 $config_options[$content_types_id]['page'] = true; 346 347 } 347 348 } -
sitetree/tags/6.0.2/data-model/dashboard-page-data.php
r2517376 r2525101 551 551 552 552 $sitemap_fieldset = new Fieldset( $fieldset_tooltip, 'sitemap_content_types' ); 553 $sitemap_fieldset->addField( new Field( 'page', 'Checkbox', 'bool', '', $tooltips['pages'], true ) ); 553 554 $sitemap_fieldset->addField( new Field( 'post', 'Checkbox', 'bool', '', $tooltips['posts'], true ) ); 554 555 … … 567 568 } 568 569 569 $sitemap_fieldset->setDescription( __( 'Pages will be included automatically.', 'sitetree' ) );570 570 $sitemap_section->addField( $sitemap_fieldset ); 571 571 $sitemap_section->addField( new Field( 'max_permalinks_in_sitemap', 'NumberField', 'positive_number', -
sitetree/tags/6.0.2/includes/builders/stylesheet-builder.class.php
r2517376 r2525101 187 187 188 188 #counter-head { 189 width: 30px;189 width: 45px; 190 190 } 191 191 … … 422 422 423 423 #counter-head { 424 width: 30px;424 width: 45px; 425 425 } 426 426 … … 631 631 632 632 #counter-head { 633 min-width: 30px;633 min-width: 40px; 634 634 } 635 635 -
sitetree/tags/6.0.2/includes/core-delegate.class.php
r2521279 r2525101 231 231 exit; 232 232 } 233 } 234 else { 235 header( 'HTTP/1.0 404 Not Found' ); 236 237 exit; 233 238 } 234 239 -
sitetree/tags/6.0.2/includes/core.class.php
r2517376 r2525101 362 362 */ 363 363 public function isContentTypeIncluded( $content_type, $sitemap_slug, $default = false ) { 364 if ( ( $sitemap_slug === 'sitemap' ) && ( $content_type === 'page' ) ) {365 return true;366 }367 368 364 $option_key_group = $sitemap_slug . '_content_types'; 369 365 -
sitetree/tags/6.0.2/includes/indexer.class.php
r2517376 r2525101 158 158 159 159 if ( $this->requestedSitemapID == 'index' ) { 160 switch ( $this->requestedSitemapSlug ) { 161 case 'sitemap': 162 $this->requestedSitemapContentType = 'page'; 160 if ( $this->requestedSitemapSlug == 'sitemap' ) { 161 $this->requestedSitemapContentType = 'page'; 162 } 163 else { 164 $this->requestedSitemapContentType = 'post'; 165 } 166 167 $post_types = get_post_types( array( 'public' => true ) ); 168 169 foreach ( $post_types as $post_type ) { 170 if ( $this->plugin->isContentTypeIncluded( $post_type, $this->requestedSitemapSlug ) ) { 171 $this->requestedSitemapContentType = $post_type; 172 163 173 break; 164 165 case 'newsmap': 166 $post_types = get_post_types( array( 'public' => true ) ); 167 168 $this->requestedSitemapContentType = 'post'; 169 170 foreach ( $post_types as $post_type ) { 171 if ( $this->plugin->isContentTypeIncluded( $post_type, 'newsmap' ) ) { 172 $this->requestedSitemapContentType = $post_type; 173 174 break; 175 } 176 } 177 break; 174 } 178 175 } 179 176 } … … 306 303 */ 307 304 private function countCustomPosts() { 308 $meta_keys = $this->db->prepareMetaKey( "exclude_from_{$this->requestedSitemapSlug}" ); 305 $meta_keys = $this->db->prepareMetaKey( "exclude_from_{$this->requestedSitemapSlug}" ); 306 $post_types = get_post_types( array( 'public' => true ) ); 307 308 foreach ( $post_types as $post_type ) { 309 if ( $this->plugin->isContentTypeIncluded( $post_type, $this->requestedSitemapSlug ) ) { 310 $this->postTypesList .= "'" . $post_type . "',"; 311 } 312 } 313 314 // Removes the trailing comma from the string. 315 $this->postTypesList = substr( $this->postTypesList, 0, -1 ); 316 317 $sitemap_orderby = ''; 309 318 310 319 if ( $this->requestedSitemapSlug == 'sitemap' ) { 311 $this->postTypesList = "'page',";312 313 $sitemap_orderby = "CASE WHEN ( content_type = 'page' ) THEN 0 ELSE 1 END,";314 320 $newsmap_where_condition = ''; 315 321 $meta_keys .= ','; 316 322 $meta_keys .= $this->db->prepareMetaKey( 'is_ghost_page' ); 317 323 324 if ( $this->plugin->isContentTypeIncluded( 'page', 'sitemap' ) ) { 325 $sitemap_orderby = "CASE WHEN ( content_type = 'page' ) THEN 0 ELSE 1 END,"; 326 } 327 318 328 if ( get_option( 'page_on_front' ) <= 0 ) { 319 329 $this->totalNumberOfPermalinks += 1; … … 321 331 } 322 332 else { 323 $sitemap_orderby = '';324 333 $newsmap_where_condition = 'AND ( p.post_date_gmt >= UTC_TIMESTAMP() - INTERVAL 2 DAY )'; 325 334 } 326 327 $post_types = get_post_types( array( 'public' => true ) );328 329 foreach ( $post_types as $post_type ) {330 if ( $this->plugin->isContentTypeIncluded( $post_type, $this->requestedSitemapSlug ) ) {331 $this->postTypesList .= "'" . $post_type . "',";332 }333 }334 335 // Removes the trailing comma from the string.336 $this->postTypesList = substr( $this->postTypesList, 0, -1 );337 335 338 336 $query_clauses = array( -
sitetree/tags/6.0.2/includes/upgrader.class.php
r2517376 r2525101 26 26 delete_transient( 'sitetree_xml' ); 27 27 } 28 elseif ( version_compare( $version_to_upgrade_from, '6.0', '>=' ) ) { 29 if ( version_compare( $version_to_upgrade_from, '6.0.2', '<' ) ) { 30 $this->includePageContentTypeInSitemap(); 31 } 32 } 28 33 elseif ( version_compare( $version_to_upgrade_from, '5.0', '>=' ) ) { 29 34 if ( version_compare( $version_to_upgrade_from, '5.1', '<' ) ) { … … 34 39 } 35 40 36 if ( version_compare( $version_to_upgrade_from, '6.0', '<' ) ) { 37 $this->db->deleteNonAutoloadOption( 'stats' ); 38 39 $this->plugin->registerRewriteRules(); 40 flush_rewrite_rules( false ); 41 } 41 $this->includePageContentTypeInSitemap(); 42 $this->db->deleteNonAutoloadOption( 'stats' ); 43 44 $this->plugin->registerRewriteRules(); 45 flush_rewrite_rules( false ); 42 46 } 43 47 elseif ( version_compare( $version_to_upgrade_from, '4.0', '>=' ) ) { … … 359 363 $this->db->deleteOption( 'exclude_childs', 'page', 'site_tree' ); 360 364 } 365 366 /** 367 * @since 6.0.2 368 */ 369 private function includePageContentTypeInSitemap() { 370 if ( $this->plugin->isSitemapActive( 'sitemap' ) ) { 371 $this->db->setOption( 'page', true, 'sitemap_content_types' ); 372 } 373 } 361 374 } -
sitetree/tags/6.0.2/readme.txt
r2521279 r2525101 7 7 Tested up to: 5.7.1 8 8 Requires PHP: 5.6.20 9 Stable tag: 6.0. 19 Stable tag: 6.0.2 10 10 License: GPLv3 11 11 License URI: https://opensource.org/licenses/GPL-3.0 … … 135 135 == Upgrade Notice == 136 136 137 = 6.0. 1=137 = 6.0.2 = 138 138 139 139 You might need to act on the 'Max. number of items' setting in the 'Site Tree Settings' screen to allow the plugin to show in the Site Tree the whole list of your Posts or Custom Posts. … … 142 142 == Changelog == 143 143 144 = 6.0.2 (3 May 2021) = 145 146 Now you can tell SiteTree to not generate the 'Page' Google Sitemap by excluding the 'page' content type — you have to click on 'Configure' in the 'Google Sitemaps' pane. 147 148 Also, fixed a bug that caused non-existent Google Sitemaps to be served anyway as empty sitemaps. 149 150 144 151 = 6.0.1 (26 April 2021) = 145 152 146 Fixed a bug where a PHP notice could show up in the site's home page when a static homepage was set.153 Fixed a bug where a PHP notice could show up in the site's home page when a static home page was set. 147 154 148 155 -
sitetree/tags/6.0.2/sitetree.php
r2521279 r2525101 4 4 * Plugin URI: https://luigicavalieri.com/sitetree/ 5 5 * Description: Sitemaps, Hyper-lists and Beyond. 6 * Version: 6.0. 16 * Version: 6.0.2 7 7 * Requires: 5.5 8 8 * Supported Leaves: wonder 1.1, multilingual 1.1 … … 14 14 * 15 15 * @package SiteTree 16 * @version 6.0. 116 * @version 6.0.2 17 17 * @copyright Copyright 2021 Luigi Cavalieri. 18 18 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0 -
sitetree/trunk/admin/page-controller-classes.php
r2521279 r2525101 317 317 $sitemap_filename_has_changed = false; 318 318 319 if ( $form_id == 'sitemap' ) { 320 $old_sitemap_filename = $this->db->getOption( 'sitemap_filename' ); 321 } 322 else { 323 $content_types_id = $form_id . '_content_types'; 324 $content_flags = $config_options[$content_types_id]; 325 $at_least_one_content_type_is_included = false; 326 327 foreach ( $content_flags as $content_type_included ) { 328 if ( $content_type_included ) { 329 $at_least_one_content_type_is_included = true; 330 331 break; 332 } 333 } 334 335 if (! $at_least_one_content_type_is_included ) { 336 if ( $form_id === 'newsmap' ) { 337 $config_options[$content_types_id]['post'] = true; 338 } 339 else { 340 $config_options[$content_types_id]['page'] = true; 341 } 342 } 343 344 if ( $form_id == 'site_tree' ) { 319 switch ( $form_id ) { 320 case 'site_tree': 345 321 $old_site_tree_id = (int) $this->db->getOption( 'page_for_site_tree' ); 322 break; 323 324 case 'sitemap': 325 $old_sitemap_filename = $this->db->getOption( 'sitemap_filename' ); 326 break; 327 } 328 329 $content_types_id = $form_id . '_content_types'; 330 $content_flags = $config_options[$content_types_id]; 331 $at_least_one_content_type_is_included = false; 332 333 foreach ( $content_flags as $content_type_included ) { 334 if ( $content_type_included ) { 335 $at_least_one_content_type_is_included = true; 336 337 break; 338 } 339 } 340 341 if (! $at_least_one_content_type_is_included ) { 342 if ( $form_id === 'newsmap' ) { 343 $config_options[$content_types_id]['post'] = true; 344 } 345 else { 346 $config_options[$content_types_id]['page'] = true; 346 347 } 347 348 } -
sitetree/trunk/data-model/dashboard-page-data.php
r2517376 r2525101 551 551 552 552 $sitemap_fieldset = new Fieldset( $fieldset_tooltip, 'sitemap_content_types' ); 553 $sitemap_fieldset->addField( new Field( 'page', 'Checkbox', 'bool', '', $tooltips['pages'], true ) ); 553 554 $sitemap_fieldset->addField( new Field( 'post', 'Checkbox', 'bool', '', $tooltips['posts'], true ) ); 554 555 … … 567 568 } 568 569 569 $sitemap_fieldset->setDescription( __( 'Pages will be included automatically.', 'sitetree' ) );570 570 $sitemap_section->addField( $sitemap_fieldset ); 571 571 $sitemap_section->addField( new Field( 'max_permalinks_in_sitemap', 'NumberField', 'positive_number', -
sitetree/trunk/includes/builders/stylesheet-builder.class.php
r2517376 r2525101 187 187 188 188 #counter-head { 189 width: 30px;189 width: 45px; 190 190 } 191 191 … … 422 422 423 423 #counter-head { 424 width: 30px;424 width: 45px; 425 425 } 426 426 … … 631 631 632 632 #counter-head { 633 min-width: 30px;633 min-width: 40px; 634 634 } 635 635 -
sitetree/trunk/includes/core-delegate.class.php
r2521279 r2525101 231 231 exit; 232 232 } 233 } 234 else { 235 header( 'HTTP/1.0 404 Not Found' ); 236 237 exit; 233 238 } 234 239 -
sitetree/trunk/includes/core.class.php
r2517376 r2525101 362 362 */ 363 363 public function isContentTypeIncluded( $content_type, $sitemap_slug, $default = false ) { 364 if ( ( $sitemap_slug === 'sitemap' ) && ( $content_type === 'page' ) ) {365 return true;366 }367 368 364 $option_key_group = $sitemap_slug . '_content_types'; 369 365 -
sitetree/trunk/includes/indexer.class.php
r2517376 r2525101 158 158 159 159 if ( $this->requestedSitemapID == 'index' ) { 160 switch ( $this->requestedSitemapSlug ) { 161 case 'sitemap': 162 $this->requestedSitemapContentType = 'page'; 160 if ( $this->requestedSitemapSlug == 'sitemap' ) { 161 $this->requestedSitemapContentType = 'page'; 162 } 163 else { 164 $this->requestedSitemapContentType = 'post'; 165 } 166 167 $post_types = get_post_types( array( 'public' => true ) ); 168 169 foreach ( $post_types as $post_type ) { 170 if ( $this->plugin->isContentTypeIncluded( $post_type, $this->requestedSitemapSlug ) ) { 171 $this->requestedSitemapContentType = $post_type; 172 163 173 break; 164 165 case 'newsmap': 166 $post_types = get_post_types( array( 'public' => true ) ); 167 168 $this->requestedSitemapContentType = 'post'; 169 170 foreach ( $post_types as $post_type ) { 171 if ( $this->plugin->isContentTypeIncluded( $post_type, 'newsmap' ) ) { 172 $this->requestedSitemapContentType = $post_type; 173 174 break; 175 } 176 } 177 break; 174 } 178 175 } 179 176 } … … 306 303 */ 307 304 private function countCustomPosts() { 308 $meta_keys = $this->db->prepareMetaKey( "exclude_from_{$this->requestedSitemapSlug}" ); 305 $meta_keys = $this->db->prepareMetaKey( "exclude_from_{$this->requestedSitemapSlug}" ); 306 $post_types = get_post_types( array( 'public' => true ) ); 307 308 foreach ( $post_types as $post_type ) { 309 if ( $this->plugin->isContentTypeIncluded( $post_type, $this->requestedSitemapSlug ) ) { 310 $this->postTypesList .= "'" . $post_type . "',"; 311 } 312 } 313 314 // Removes the trailing comma from the string. 315 $this->postTypesList = substr( $this->postTypesList, 0, -1 ); 316 317 $sitemap_orderby = ''; 309 318 310 319 if ( $this->requestedSitemapSlug == 'sitemap' ) { 311 $this->postTypesList = "'page',";312 313 $sitemap_orderby = "CASE WHEN ( content_type = 'page' ) THEN 0 ELSE 1 END,";314 320 $newsmap_where_condition = ''; 315 321 $meta_keys .= ','; 316 322 $meta_keys .= $this->db->prepareMetaKey( 'is_ghost_page' ); 317 323 324 if ( $this->plugin->isContentTypeIncluded( 'page', 'sitemap' ) ) { 325 $sitemap_orderby = "CASE WHEN ( content_type = 'page' ) THEN 0 ELSE 1 END,"; 326 } 327 318 328 if ( get_option( 'page_on_front' ) <= 0 ) { 319 329 $this->totalNumberOfPermalinks += 1; … … 321 331 } 322 332 else { 323 $sitemap_orderby = '';324 333 $newsmap_where_condition = 'AND ( p.post_date_gmt >= UTC_TIMESTAMP() - INTERVAL 2 DAY )'; 325 334 } 326 327 $post_types = get_post_types( array( 'public' => true ) );328 329 foreach ( $post_types as $post_type ) {330 if ( $this->plugin->isContentTypeIncluded( $post_type, $this->requestedSitemapSlug ) ) {331 $this->postTypesList .= "'" . $post_type . "',";332 }333 }334 335 // Removes the trailing comma from the string.336 $this->postTypesList = substr( $this->postTypesList, 0, -1 );337 335 338 336 $query_clauses = array( -
sitetree/trunk/includes/upgrader.class.php
r2517376 r2525101 26 26 delete_transient( 'sitetree_xml' ); 27 27 } 28 elseif ( version_compare( $version_to_upgrade_from, '6.0', '>=' ) ) { 29 if ( version_compare( $version_to_upgrade_from, '6.0.2', '<' ) ) { 30 $this->includePageContentTypeInSitemap(); 31 } 32 } 28 33 elseif ( version_compare( $version_to_upgrade_from, '5.0', '>=' ) ) { 29 34 if ( version_compare( $version_to_upgrade_from, '5.1', '<' ) ) { … … 34 39 } 35 40 36 if ( version_compare( $version_to_upgrade_from, '6.0', '<' ) ) { 37 $this->db->deleteNonAutoloadOption( 'stats' ); 38 39 $this->plugin->registerRewriteRules(); 40 flush_rewrite_rules( false ); 41 } 41 $this->includePageContentTypeInSitemap(); 42 $this->db->deleteNonAutoloadOption( 'stats' ); 43 44 $this->plugin->registerRewriteRules(); 45 flush_rewrite_rules( false ); 42 46 } 43 47 elseif ( version_compare( $version_to_upgrade_from, '4.0', '>=' ) ) { … … 359 363 $this->db->deleteOption( 'exclude_childs', 'page', 'site_tree' ); 360 364 } 365 366 /** 367 * @since 6.0.2 368 */ 369 private function includePageContentTypeInSitemap() { 370 if ( $this->plugin->isSitemapActive( 'sitemap' ) ) { 371 $this->db->setOption( 'page', true, 'sitemap_content_types' ); 372 } 373 } 361 374 } -
sitetree/trunk/readme.txt
r2521279 r2525101 7 7 Tested up to: 5.7.1 8 8 Requires PHP: 5.6.20 9 Stable tag: 6.0. 19 Stable tag: 6.0.2 10 10 License: GPLv3 11 11 License URI: https://opensource.org/licenses/GPL-3.0 … … 135 135 == Upgrade Notice == 136 136 137 = 6.0. 1=137 = 6.0.2 = 138 138 139 139 You might need to act on the 'Max. number of items' setting in the 'Site Tree Settings' screen to allow the plugin to show in the Site Tree the whole list of your Posts or Custom Posts. … … 142 142 == Changelog == 143 143 144 = 6.0.2 (3 May 2021) = 145 146 Now you can tell SiteTree to not generate the 'Page' Google Sitemap by excluding the 'page' content type — you have to click on 'Configure' in the 'Google Sitemaps' pane. 147 148 Also, fixed a bug that caused non-existent Google Sitemaps to be served anyway as empty sitemaps. 149 150 144 151 = 6.0.1 (26 April 2021) = 145 152 146 Fixed a bug where a PHP notice could show up in the site's home page when a static homepage was set.153 Fixed a bug where a PHP notice could show up in the site's home page when a static home page was set. 147 154 148 155 -
sitetree/trunk/sitetree.php
r2521279 r2525101 4 4 * Plugin URI: https://luigicavalieri.com/sitetree/ 5 5 * Description: Sitemaps, Hyper-lists and Beyond. 6 * Version: 6.0. 16 * Version: 6.0.2 7 7 * Requires: 5.5 8 8 * Supported Leaves: wonder 1.1, multilingual 1.1 … … 14 14 * 15 15 * @package SiteTree 16 * @version 6.0. 116 * @version 6.0.2 17 17 * @copyright Copyright 2021 Luigi Cavalieri. 18 18 * @license https://opensource.org/licenses/GPL-3.0 GPL v3.0
Note: See TracChangeset
for help on using the changeset viewer.