钩子文档

wp_sitemaps_stylesheet_index_url

💡 云策文档标注

概述

本文档介绍了 wp_sitemaps_stylesheet_index_url 过滤器,用于修改站点地图索引样式表的 URL。如果返回假值,将不使用样式表,直接显示原始 XML。

关键要点

  • 过滤器名称:wp_sitemaps_stylesheet_index_url
  • 参数:$sitemap_url(字符串,站点地图索引 XSL 文件的完整 URL)
  • 返回值:可修改 URL 或返回 falsey 值以禁用样式表
  • 引入版本:WordPress 5.5.0
  • 相关函数:WP_Sitemaps_Renderer::get_sitemap_index_stylesheet_url()

📄 原文内容

Filters the URL for the sitemap index stylesheet.

Description

If a falsey value is returned, no stylesheet will be used and the “raw” XML of the sitemap index will be displayed.

Parameters

$sitemap_urlstring
Full URL for the sitemaps index XSL file.

Source

return apply_filters( 'wp_sitemaps_stylesheet_index_url', $sitemap_url );

Changelog

Version Description
5.5.0 Introduced.