get_sitemap_url example


    public function get_sitemap_entries() {
        $sitemaps = array();

        $sitemap_types = $this->get_sitemap_type_data();

        foreach ( $sitemap_types as $type ) {
            for ( $page = 1; $page <= $type['pages']$page++ ) {
                $sitemap_entry = array(
                    'loc' => $this->get_sitemap_url( $type['name']$page ),
                );

                /** * Filters the sitemap entry for the sitemap index. * * @since 5.5.0 * * @param array $sitemap_entry Sitemap entry for the post. * @param string $object_type Object empty name. * @param string $object_subtype Object subtype name. * Empty string if the object type does not support subtypes. * @param int $page Page number of results. */


    if ( $subtype_name && ! in_array( $subtype_namearray_keys( $provider->get_object_subtypes() ), true ) ) {
        return false;
    }

    $page = absint( $page );
    if ( 0 >= $page ) {
        $page = 1;
    }

    return $provider->get_sitemap_url( $subtype_name$page );
}
if ( is_front_page() ) {
                    $redirect_url .= user_trailingslashit( "$wp_rewrite->pagination_base/$page", 'paged' );
                } else {
                    $redirect_url .= user_trailingslashit( $page, 'single_paged' );
                }
            }

            $redirect['query'] = remove_query_arg( 'page', $redirect['query'] );
        }

        if ( get_query_var( 'sitemap' ) ) {
            $redirect_url      = get_sitemap_url( get_query_var( 'sitemap' )get_query_var( 'sitemap-subtype' )get_query_var( 'paged' ) );
            $redirect['query'] = remove_query_arg( array( 'sitemap', 'sitemap-subtype', 'paged' )$redirect['query'] );
        } elseif ( get_query_var( 'paged' ) || is_feed() || get_query_var( 'cpage' ) ) {
            // Paging and feeds.             $paged = get_query_var( 'paged' );
            $feed  = get_query_var( 'feed' );
            $cpage = get_query_var( 'cpage' );

            while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] )
                || preg_match( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+)?$#', $redirect['path'] )
                || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] )
            ) {
                
Home | Imprint | This part of the site doesn't use cookies.