You appear to be a bot. Output may be restricted
Description
Returns the xsl of a sitemap index xml file as a string.
Usage
$string = Jetpack_Sitemap_Stylist::sitemap_index_xsl();
Parameters
Returns
string The contents of the xsl file.
Source
File name: jetpack/modules/sitemaps/sitemap-stylist.php
Lines:
1 to 100 of 115
public static function sitemap_index_xsl() { $title = esc_html( ent2ncr( __( 'XML Sitemap Index', 'jetpack' ) ) ); $header_url = esc_html( ent2ncr( __( 'Sitemap URL', 'jetpack' ) ) ); $header_lastmod = esc_html( ent2ncr( __( 'Last Modified', 'jetpack' ) ) ); $description = self::sanitize_with_links( __( 'This is an XML Sitemap Index generated by <a href="%1$s" rel="noopener noreferrer" target="_blank">Jetpack</a>, meant to be consumed by search engines like <a href="%2$s" rel="noopener noreferrer" target="_blank">Google</a> or <a href="%3$s" rel="noopener noreferrer" target="_blank">Bing</a>.', 'jetpack' ), array( 1 => 'https://jetpack.com/', 2 => 'https://www.google.com/', 3 => 'https://www.bing.com/', ) ); if ( current_user_can( 'manage_options' ) ) { $next = human_time_diff( wp_next_scheduled( 'jp_sitemap_cron_hook' ) ); /* translators: %s is a human_time_diff until next sitemap generation. */ $no_nodes_warning = sprintf( __( 'No sitemap found. The system will try to build it again in %s.', 'jetpack' ), $next ); } else { $no_nodes_warning = ''; } $more_info = self::sanitize_with_links( __( 'You can find more information on XML sitemaps at <a href="%1$s" rel="noopener noreferrer" target="_blank">sitemaps.org</a>', 'jetpack' ), array( 1 => 'https://sitemaps.org', ) ); $generated_by = self::sanitize_with_links( __( 'Generated by <a href="%s" rel="noopener noreferrer" target="_blank">Jetpack for WordPress</a>', 'jetpack' ), array( 1 => 'https://jetpack.com', ) ); $css = self::sitemap_xsl_css(); return <<<XSL <?xml version='1.0' encoding='UTF-8'?> <xsl:stylesheet version='2.0' xmlns:html='http://www.w3.org/TR/REC-html40' xmlns:sitemap='http://www.sitemaps.org/schemas/sitemap/0.9' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>$title</title> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <style type='text/css'> $css </style> </head> <body> <div id='description'> <h1>$title</h1> <xsl:choose> <xsl:when test='not(sitemap:sitemapindex/sitemap:sitemap)'> <p><strong>$no_nodes_warning</strong></p> </xsl:when> </xsl:choose> <p>$description</p> <p>$more_info</p> </div> <div id='content'> <table> <tr> <th>#</th> <th>$header_url</th> <th>$header_lastmod</th> </tr> <xsl:for-each select='sitemap:sitemapindex/sitemap:sitemap'> <tr> <xsl:choose> <xsl:when test='position() mod 2 != 1'> <xsl:attribute name="class">odd</xsl:attribute> </xsl:when> </xsl:choose> <td> <xsl:value-of select = "position()" /> </td> <td> <xsl:variable name='itemURL'> <xsl:value-of select='sitemap:loc'/> </xsl:variable> <a href='{\$itemURL}'> <xsl:value-of select='sitemap:loc'/> </a> </td> <td>