函数文档

wp_title_rss()

💡 云策文档标注

概述

wp_title_rss() 函数用于在 RSS 或 Atom 源中显示博客标题。该函数已弃用参数,并提供了过滤器以自定义输出。

关键要点

  • 函数 wp_title_rss() 输出博客标题,适用于 feed 标题显示。
  • 参数 $deprecated 已弃用,自 4.4.0 版本起建议使用 'document_title_separator' 过滤器替代。
  • 内部调用 get_wp_title_rss() 获取标题,并通过 apply_filters('wp_title_rss', ...) 应用过滤器。
  • 相关函数包括 get_wp_title_rss()、__()、_deprecated_argument() 和 apply_filters()。
  • 版本变更:4.4.0 弃用 $sep 参数并重命名为 $deprecated,2.2.0 引入此函数。

📄 原文内容

Displays the blog title for display of the feed title.

Parameters

$deprecatedstringrequired
Unused.

Source

function wp_title_rss( $deprecated = '–' ) {
	if ( '–' !== $deprecated ) {
		/* translators: %s: 'document_title_separator' filter name. */
		_deprecated_argument( __FUNCTION__, '4.4.0', sprintf( __( 'Use the %s filter instead.' ), '<code>document_title_separator</code>' ) );
	}

	/**
	 * Filters the blog title for display of the feed title.
	 *
	 * @since 2.2.0
	 * @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`.
	 *
	 * @see get_wp_title_rss()
	 *
	 * @param string $wp_title_rss The current blog title.
	 * @param string $deprecated   Unused.
	 */
	echo apply_filters( 'wp_title_rss', get_wp_title_rss(), $deprecated );
}

Hooks

apply_filters( ‘wp_title_rss’, string $wp_title_rss, string $deprecated )

Filters the blog title for display of the feed title.

Changelog

Version Description
4.4.0 The optional $sep parameter was deprecated and renamed to $deprecated.
2.2.0 Introduced.