钩子文档

bloginfo

💡 云策文档标注

概述

bloginfo 是一个 WordPress 过滤器钩子,用于过滤 get_bloginfo() 函数返回的站点信息。它允许开发者修改或自定义非 URL 类型的站点数据输出。

关键要点

  • bloginfo 过滤器应用于 get_bloginfo() 函数,用于过滤非 URL 站点信息。
  • 参数包括 $output(请求的非 URL 站点信息)和 $show(请求的信息类型)。
  • 注意:bloginfo("url")、bloginfo("directory") 和 bloginfo("home") 不应用此过滤器钩子,应使用 bloginfo_url 代替。
  • 源代码为 $output = apply_filters( 'bloginfo', $output, $show );。
  • 相关函数包括 get_bloginfo(),用于检索当前站点信息。
  • 自 WordPress 版本 0.71 引入。

📄 原文内容

Filters the site information returned by get_bloginfo() .

Parameters

$outputmixed
The requested non-URL site information.
$showstring
Type of information requested.

More Information

Note that the function calls to bloginfo("url"), bloginfo("directory"), and bloginfo("home") will not have this filter hook applied (see bloginfo_url instead).

Source

$output = apply_filters( 'bloginfo', $output, $show );

Changelog

Version Description
0.71 Introduced.