Filter single post type XML sitemap query

Since SEOPress 2.4

function sp_sitemaps_single_query($args, $cpt_key) {
//Default Query  
//$args = array( 'posts_per_page' => 1000, 'order'=> 'DESC', 'orderby' => 'modified', 'post_type' => $cpt_key, 'post_status' => 'publish', 'meta_key' => '_seopress_robots_index', 'meta_value' => 'yes', 'meta_compare' => 'NOT EXISTS', 'fields' => 'ids', 'lang' => '' );
    if ($cpt_key == 'page') {
        //If Page XML Sitemap, change posts_per_page value to 100
        $args['posts_per_page'] = '100';
        return $args;
    } else {
        return $args;
    }
}
add_filter('seopress_sitemaps_single_query', 'sp_sitemaps_single_query', 10, 2);

Last modified: April 1, 2018