File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,15 @@ public static function use_custom_queries(): bool {
5555 return ! apply_filters ( 'msm_sitemap_avoid_custom_queries ' , false );
5656 }
5757
58+ public static function get_partition_suffix (): string {
59+ $ partition = apply_filters ( 'msm_sitemap_partition ' , '' );
60+ return ( empty ( $ partition ) ? '' : "- $ partition " );
61+ }
62+
63+ public static function max_sitemap_length (): int {
64+ return apply_filters ( 'msm_sitemap_max_sitemap_length ' , get_option ( 'msm_sitemap_max_sitemap_length ' , 365 * 3 ) );
65+ }
66+
5867 /**
5968 * Register 15 minute cron interval for latest articles
6069 * @param array[] $schedules
@@ -727,7 +736,7 @@ public static function build_root_sitemap_xml( $year = false ) {
727736 'post_type ' => Metro_Sitemap::SITEMAP_CPT ,
728737 'orderby ' => 'post_date ' ,
729738 'order ' => 'DESC ' ,
730- 'numberposts ' => - 1 ,
739+ 'numberposts ' => self :: max_sitemap_length () ,
731740 ];
732741 if ( is_numeric ( $ year ) ) {
733742 $ args ['m ' ] = $ year ;
You can’t perform that action at this time.
0 commit comments