get_post_format_string

函式
get_post_format_string ( $slug )
引數
  • (string) $slug A post format slug.
    Required:
返回值
  • (string) The translated post format name.
定義位置
相關方法
get_post_format_stringsget_post_format_linkget_post_format_slugsget_post_format_post_format_link
引入
3.1.0
棄用
-

get_post_format_string函式返回post格式的顯示名稱。它接受一個引數,即post格式的名稱。如果不支援post格式,則此函式返回false。

返回一個漂亮的、經過翻譯的文章格式slug。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_post_format_string( $slug ) {
$strings = get_post_format_strings();
if ( ! $slug ) {
return $strings['standard'];
} else {
return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : '';
}
}
function get_post_format_string( $slug ) { $strings = get_post_format_strings(); if ( ! $slug ) { return $strings['standard']; } else { return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : ''; } }
function get_post_format_string( $slug ) {
	$strings = get_post_format_strings();
	if ( ! $slug ) {
		return $strings['standard'];
	} else {
		return ( isset( $strings[ $slug ] ) ) ? $strings[ $slug ] : '';
	}
}

常見問題

FAQs
檢視更多 >