get_wp_title_rss

函式
get_wp_title_rss ( $deprecated = '–' )
引數
  • (string) $deprecated Unused.
    Required:
    Default: '–'
返回值
  • (string) The document title.
定義位置
相關方法
wp_title_rssget_the_title_rssthe_title_rssget_the_titlewp_title
引入
2.2.0
棄用
-

get_wp_title_rss: 這是一個WordPress的函式,用於返回一個文章的標題,以便在RSS提要中使用: 該函式把一個文章的ID作為引數,並返回文章的標題,通過wp_title_rss過濾器過濾。

檢索feed標題的部落格標題。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_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 use as the feed title.
*
* @since 2.2.0
* @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`.
*
* @param string $title The current blog title.
* @param string $deprecated Unused.
*/
return apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated );
}
function get_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 use as the feed title. * * @since 2.2.0 * @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`. * * @param string $title The current blog title. * @param string $deprecated Unused. */ return apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated ); }
function get_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 use as the feed title.
	 *
	 * @since 2.2.0
	 * @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`.
	 *
	 * @param string $title      The current blog title.
	 * @param string $deprecated Unused.
	 */
	return apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated );
}

常見問題

FAQs
檢視更多 >