• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / WPSEO_Sitemaps_Renderer::sitemap_index_url() – Build the `<sitemap>` tag for a given URL.

You appear to be a bot. Output may be restricted

Description

Build the <sitemap> tag for a given URL.

Usage

$string = WPSEO_Sitemaps_Renderer::sitemap_index_url( $url );

Parameters

$url
( array ) required – Array of parts that make up this entry.

Returns

string

Source

File name: wordpress-seo/inc/sitemaps/class-sitemaps-renderer.php


Lines:

1 to 18 of 18
  protected function sitemap_index_url( $url ) {

    $date = null;

    if ( ! empty( $url['lastmod'] ) ) {
      $date = YoastSEO()->helpers->date->format( $url['lastmod'] );
    }

    $url['loc'] = htmlspecialchars( $url['loc'], ENT_COMPAT, $this->output_charset, false );

    $output  = "\t<sitemap>\n";
    $output .= "\t\t<loc>" . $url['loc'] . "</loc>\n";
    $output .= empty( $date ) ? '' : "\t\t<lastmod>" . htmlspecialchars( $date, ENT_COMPAT, $this->output_charset, false ) . "</lastmod>\n";
    $output .= "\t</sitemap>\n";

    return $output;
  }
 

 View on GitHub View on Trac

Published: 27th November 2019 | Last updated: 22nd February 2021

Primary Sidebar

Information

Function name: WPSEO_Sitemaps_Renderer::sitemap_index_url
Class ref: WPSEO_Sitemaps_Renderer
Plugin ref: Yoast SEO
Version: 15.9
Sourcefile: inc/sitemaps/class-sitemaps-renderer.php
File ref: inc/sitemaps/class-sitemaps-renderer.php
Deprecated?: No
API Letters: I,R,S,W

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 5.6.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites