File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ public static function get_partition_suffix(): string {
6161 return ( empty ( $ partition ) ? '' : "- $ partition " );
6262 }
6363
64+ public static function max_sitemap_length (): int {
65+ return apply_filters ( 'msm_sitemap_max_sitemap_length ' , get_option ( 'msm_sitemap_max_sitemap_length ' , 365 * 3 ) );
66+ }
67+
6468 /**
6569 * Register 15 minute cron interval for latest articles
6670 * @param array[] $schedules
@@ -722,7 +726,7 @@ public static function build_root_sitemap_xml( $year = false ) {
722726 'post_type ' => Metro_Sitemap::SITEMAP_CPT ,
723727 'orderby ' => 'post_date ' ,
724728 'order ' => 'DESC ' ,
725- 'numberposts ' => - 1 ,
729+ 'numberposts ' => self :: max_sitemap_length () ,
726730 ];
727731 if ( is_numeric ( $ year ) ) {
728732 $ args ['m ' ] = $ year ;
You can’t perform that action at this time.
0 commit comments