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’}過濾器。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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";
}
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"; }
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
檢視更多 >