钩子文档

wp_sitemaps_posts_show_on_front_entry

💡 云策文档标注

概述

此文档介绍 wp_sitemaps_posts_show_on_front_entry 过滤器,用于在 WordPress 站点地图中自定义首页条目,当 'show_on_front' 选项设置为 'posts' 时生效。

关键要点

  • 过滤器名称:wp_sitemaps_posts_show_on_front_entry
  • 参数:$sitemap_entry(数组类型,表示首页的站点地图条目)
  • 用途:允许开发者修改首页在站点地图中的条目数据
  • 引入版本:WordPress 5.5.0
  • 相关函数:在 WP_Sitemaps_Posts::get_url_list() 方法中调用

📄 原文内容

Filters the sitemap entry for the home page when the ‘show_on_front’ option equals ‘posts’.

Parameters

$sitemap_entryarray
Sitemap entry for the home page.

Source

$sitemap_entry = apply_filters( 'wp_sitemaps_posts_show_on_front_entry', $sitemap_entry );

Changelog

Version Description
5.5.0 Introduced.