allowed_tags

函式
allowed_tags ( No parameters )
返回值
  • (string) HTML allowed tags entity encoded.
定義位置
相關方法
get_allowed_themesadd_allowed_optionswp_allowed_protocolsbalancetagsget_allowed_http_origins
引入
1.0.1
棄用
-

allowed_tags: 這是一個WordPress的函式,它返回一個允許的HTML標籤和屬性陣列,用於wp_kses函式。

以HTML格式顯示所有允許的標籤和屬性。

這對在評論區顯示哪些元素和屬性是支援的很有用。以及任何想要顯示它的外掛。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function allowed_tags() {
global $allowedtags;
$allowed = '';
foreach ( (array) $allowedtags as $tag => $attributes ) {
$allowed .= '<' . $tag;
if ( 0 < count( $attributes ) ) {
foreach ( $attributes as $attribute => $limits ) {
$allowed .= ' ' . $attribute . '=""';
}
}
$allowed .= '> ';
}
return htmlentities( $allowed );
}
function allowed_tags() { global $allowedtags; $allowed = ''; foreach ( (array) $allowedtags as $tag => $attributes ) { $allowed .= '<' . $tag; if ( 0 < count( $attributes ) ) { foreach ( $attributes as $attribute => $limits ) { $allowed .= ' ' . $attribute . '=""'; } } $allowed .= '> '; } return htmlentities( $allowed ); }
function allowed_tags() {
	global $allowedtags;
	$allowed = '';
	foreach ( (array) $allowedtags as $tag => $attributes ) {
		$allowed .= '<' . $tag;
		if ( 0 < count( $attributes ) ) {
			foreach ( $attributes as $attribute => $limits ) {
				$allowed .= ' ' . $attribute . '=""';
			}
		}
		$allowed .= '> ';
	}
	return htmlentities( $allowed );
}

常見問題

FAQs
檢視更多 >