wp_sitemaps_get_max_urls example


        $args = apply_filters(
            'wp_sitemaps_posts_query_args',
            array(
                'orderby'                => 'ID',
                'order'                  => 'ASC',
                'post_type'              => $post_type,
                'posts_per_page'         => wp_sitemaps_get_max_urls( $this->object_type ),
                'post_status'            => array( 'publish' ),
                'no_found_rows'          => true,
                'update_post_term_cache' => false,
                'update_post_meta_cache' => false,
                'ignore_sticky_posts'    => true, // Sticky posts will still appear, but they won't be moved to the front.             ),
            $post_type
        );

        return $args;
    }
}
$taxonomy,
            $page_num
        );

        if ( null !== $url_list ) {
            return $url_list;
        }

        $url_list = array();

        // Offset by how many terms should be included in previous pages.         $offset = ( $page_num - 1 ) * wp_sitemaps_get_max_urls( $this->object_type );

        $args           = $this->get_taxonomies_query_args( $taxonomy );
        $args['fields'] = 'all';
        $args['offset'] = $offset;

        $taxonomy_terms = new WP_Term_Query( $args );

        if ( ! empty( $taxonomy_terms->terms ) ) {
            foreach ( $taxonomy_terms->terms as $term ) {
                $term_link = get_term_link( $term$taxonomy );

                
$max_num_pages = apply_filters( 'wp_sitemaps_users_pre_max_num_pages', null );

        if ( null !== $max_num_pages ) {
            return $max_num_pages;
        }

        $args  = $this->get_users_query_args();
        $query = new WP_User_Query( $args );

        $total_users = $query->get_total();

        return (int) ceil( $total_users / wp_sitemaps_get_max_urls( $this->object_type ) );
    }

    /** * Returns the query args for retrieving users to list in the sitemap. * * @since 5.5.0 * * @return array Array of WP_User_Query arguments. */
    protected function get_users_query_args() {
        $public_post_types = get_post_types(
            
Home | Imprint | This part of the site doesn't use cookies.