the_generator

函数
the_generator ( $type )
参数
  • (string) $type The type of generator to output - (html|xhtml|atom|rss2|rdf|comment|export).
    Required:
定义位置
相关方法
get_the_generatorwp_generatorthe_editorthe_authorthe_excerpt
引入
2.5.0
弃用
-

the_generator – 这个函数用来输出当前安装的WordPress软件的版本号。它通常用在WordPress主题的头部部分。

显示RSS、ATOM等的生成器XML或Comment。

为请求的输出格式返回正确的生成器类型。允许一个插件在整体上过滤生成器{@see ‘the_generator’}过滤器。

function the_generator( $type ) {
	/**
	 * Filters the output of the XHTML generator tag for display.
	 *
	 * @since 2.5.0
	 *
	 * @param string $generator_type The generator output.
	 * @param string $type           The type of generator to output. Accepts 'html',
	 *                               'xhtml', 'atom', 'rss2', 'rdf', 'comment', 'export'.
	 */
	echo apply_filters( 'the_generator', get_the_generator( $type ), $type ) . "n";
}

常见问题

FAQs
查看更多 >
闪电伯伯

(工作日 10:00 - 18:30 为您服务)

2025-11-19 05:27:46

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: