Filter HTML sitemap query

Since SEOPress 2.4

function sp_sitemaps_html_query($args, $cpt_key) {
//Default Query  
//$args = array( 'posts_per_page' => 1000, 'order'=> 'DESC', 'orderby' => 'date', 'post_type' => $cpt_key, 'post_status' => 'publish', 'meta_key' => '_seopress_robots_index', 'meta_value' => 'yes', 'meta_compare' => 'NOT EXISTS', 'fields' => 'ids', 'exclude' => $seopress_xml_sitemap_html_exclude_option );
    if ($cpt_key =='page') {
    //If page post type, order page by admin menu order
        $args['order'] = 'ASC';
        $args['orderby'] = 'menu_order';
        return $args;
    } else {
        return $args;
    }
}
add_filter('seopress_sitemaps_html_query', 'sp_sitemaps_html_query', 10, 2);

Last modified: April 1, 2018