the_generator() - WordPress 函数参考中文文档

返回介绍

the_generator()

发布于 2017-09-11 字数1805 浏览 879 评论 0

the_generator( string $type )

Display the generator XML or Comment for RSS, ATOM, etc.


描述

Returns the correct generator type for the requested output format. Allows for a plugin to filter generators overall the ‘the_generator’ filter.


参数

$type

(string)
(Required)
The type of generator to output – (html|xhtml|atom|rss2|rdf|comment|export).


源代码

File: wp-includes/general-template.php

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";
}

更新日志

Version 描述
2.5.0 Introduced.

相关函数

Uses

  • wp-includes/general-template.php:
    get_the_generator()
  • wp-includes/general-template.php:
    the_generator
  • wp-includes/plugin.php:
    apply_filters()

Used By

  • wp-admin/includes/export.php:
    export_wp()
  • wp-includes/general-template.php:
    wp_generator()

User Contributed Notes

上一篇:the_feed_link()

下一篇:the_guid()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!