esc_xml example

exit;
    }

    /** * Returns the escaped XSL for all sitemaps, except index. * * @since 5.5.0 */
    public function get_sitemap_stylesheet() {
        $css         = $this->get_stylesheet_css();
        $title       = esc_xml( __( 'XML Sitemap' ) );
        $description = esc_xml( __( 'This XML Sitemap is generated by WordPress to make your content more visible for search engines.' ) );
        $learn_more  = sprintf(
            '<a href="%s">%s</a>',
            esc_url( __( 'https://www.sitemaps.org/' ) ),
            esc_xml( __( 'Learn more about XML sitemaps.' ) )
        );

        $text = sprintf(
            /* translators: %s: Number of URLs. */
            esc_xml( __( 'Number of URLs in this XML Sitemap: %s.' ) ),
            '<xsl:value-of select="count( sitemap:urlset/sitemap:url )" />'
        );

        );

        foreach ( $sitemaps as $entry ) {
            $sitemap = $sitemap_index->addChild( 'sitemap' );

            // Add each element as a child node to the <sitemap> entry.             foreach ( $entry as $name => $value ) {
                if ( 'loc' === $name ) {
                    $sitemap->addChild( $nameesc_url( $value ) );
                } elseif ( 'lastmod' === $name ) {
                    $sitemap->addChild( $nameesc_xml( $value ) );
                } else {
                    _doing_it_wrong(
                        __METHOD__,
                        sprintf(
                            /* translators: %s: List of element names. */
                            __( 'Fields other than %s are not currently supported for the sitemap index.' ),
                            implode( ',', array( 'loc', 'lastmod' ) )
                        ),
                        '5.5.0'
                    );
                }
            }
Home | Imprint | This part of the site doesn't use cookies.